David
David
NNuxt
Created by David on 3/22/2024 in #❓・help
Nuxt 2 and Directus SDK, not loading CommonJS module
Regarding the error
o.URL is not a constructor
o.URL is not a constructor
I was able to get rid of it by doing
globalThis.URL = URL;
globalThis.URL = URL;
before calling createDirectus.
12 replies
NNuxt
Created by David on 3/22/2024 in #❓・help
Nuxt 2 and Directus SDK, not loading CommonJS module
Okay I see. Thanks again for your help!
12 replies
NNuxt
Created by David on 3/22/2024 in #❓・help
Nuxt 2 and Directus SDK, not loading CommonJS module
No description
12 replies
NNuxt
Created by David on 3/22/2024 in #❓・help
Nuxt 2 and Directus SDK, not loading CommonJS module
That's right. Their index.js file is an ES module. Then, the package.json file of the Directus SDK has "type": "module", and the CommonJS file is named index.cjs. Is that really incorrect? Shouldn't the "type": "module" be a hint that index.js is an ES module and that the index.cjs file should be looked for to get the CommonJS version?
12 replies
NNuxt
Created by David on 3/22/2024 in #❓・help
Nuxt 2 and Directus SDK, not loading CommonJS module
No description
12 replies