question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module '@cloudflare/json-hyper-schema' and other start-up bumps...

See original GitHub issue

hi there 👋

i’m trying to get up and running using doca. i was able to init a local docs app:

doca init -i path/to/my/project/files/ -o ./docs
Folder docs has been created.
Importing these schemas from path/to/my/project/files/:
- manifest.json
- manifest.schema.json
Doca project files has been copied!
Customizing doca project files:
docs/schemas.js
Trying to yarn add @cloudflare/doca-default-theme for project docs...
Theme @cloudflare/doca-default-theme at docs has been successfully installed!
Setting docs theme to @cloudflare/doca-default-theme. Files changed:
docs/src/client/main.js
docs/src/server/html.js
docs/webpack/build.js

i then cd ./docs && npm i which runs fine but when i try to run the resulting app, i get Error: Cannot find module '@cloudflare/json-hyper-schema'

if i install that dependency via npm i @cloudflare/json-hyper-schema --save, i’m able to run npm run build:nojs but then the resulting app is empty - open build/index.html shows what looks like empty boilerplate.

looking at the schemas.js and getting-started.json files, i see:

>>cat ./schemas.js 
import { fromJS } from 'immutable';

export default fromJS([
  // The "getting started" schema, which is automatically added to this
  // list by the scaffolding process, provides table-of-contents links
  // for the sections in src/client/introduction.js.  You are free
  // to customize or remove both the schema and the introduction component.
  require('./getting-started.json'),

]);

and

>>cat ./getting-started.json 
{
  "id": "/getting/started",
  "title": "Getting started",
  "cfHidden": true,
  "links": [
    {
      "title": "Endpoints",
      "href": "about:endpoints"
    },
    {
      "title": "Requests",
      "href": "about:requests"
    },
    {
      "title": "Responses",
      "href": "about:responses"
    },
    {
      "title": "Resource Identifiers",
      "href": "about:identifiers"
    }
  ]
}

not sure where i went wrong but fwiw, i’m doing perhaps two things that are unexpected / not handled: 1) i’m running npm (not yarn) and 2) my data and schema are located in the same directory (manifest.json and manifest.schema.json where the former is my actual data and the later is the schema file using $schema: "http://json-schema.org/draft-07/schema#")

any pointers you could provide would be much appreciated 🙏

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
miguelmartin75commented, Dec 4, 2018

I ran into this issue as well. Doing a yarn add @cloudflare/json-hyper-schema resolves it but it’s a bit of an odd fix.

1reaction
rbucklandcommented, Mar 16, 2019

@busticated buried in your issue is the following …

  1. my data and schema are located in the same directory (manifest.json and manifest.schema.json where the former is my actual data and the later is the schema file using $schema: “http://json-schema.org/draft-07/schema#”)

any pointers you could provide would be much appreciated 🙏

I have created a feature (10 minutes) that allows you to pass in the **/*.schema.json so you can ignore the data files.

https://github.com/rbuckland/json-schema-tools/tree/feature/doca-glob-option I raised it specifically as #18

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where is the source json schema for cloudflare api v4?
Found a reference to api.cloudflare.com/schemas/v4 but it doesn't seem to be accessible. ... Are these hyper schemas published somewhere?
Read more >
Bug listing with status UNCONFIRMED as at 2022/12/28 19 ...
... Bug:431028 - "app-misc/command-not-found - In case a command could not be found this utility searches for packages containing this or a similar...
Read more >
How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >
MessagePack: It's like JSON. but fast and small.
MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller. Small ......
Read more >
list of all node.js modules created on June 24, 2013
=atsid 2013-06-04 17:01 1.0.9 JSON Schema json-schema schema AMD ioc Inversion Of ... =admc 2013-01-24 01:59 0.0.1 asap ERROR: No README.md file found!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found