@glazed/devtools - Create and add a schema to a model

Hi,

I’m following developers.ceramic tutorial:

step: Create and add a schema to a model

Using:
@ceramicnetwork/http-client”: “^2.3.0”,
@glazed/devtools”: “^0.2.0”,

and getting error:

const ceramic = new CeramicClient(‘https://ceramic-clay.3boxlabs.com’)
const manager = new ModelManager({ ceramic }) ← Error

Error:
draft7.js:17 Uncaught TypeError: (0 , applicator_1.default) is not a function
at eval (draft7.js:17:99)
at ./node_modules/@glazed/devtools/node_modules/ajv/dist/vocabularies/draft7.js (app.53fd3e10.js:3310:1)

I get the same error for:

const ceramic = new CeramicClient()
const manager = new ModelManager({ ceramic})

Any hint?
Thanks

Hi, I can’t reproduce locally so I expect it has to do with your environment.
Are you using Node.js v16 or another version please? Ceramic only supports v16.

this message (.default is not a function) suggests an issue between ESModules & commonjs.

If you’re using typescript, you probably want to check your tsconfig esModuleInterop setting. This setting controls how the default import is treated in commonjs. Workarounds include import * from ... and something involving goat’s blood on full moon. Honestly, I just spent a full month converting from CJS to ESM and I still barely understand it.

1 Like

Hi FrozenKiwi,

tsconfig = > esModuleInterop setting solved my problem.
all works fine, Thanks.

2 Likes