Build error (ES module) with node v16.15.0
See original GitHub issueHello
Using last version of SvelteKit and node 16.15.0 i get this error :
(node:15002) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. Unexpected token 'export'
adding "type":"module"
to node_modules/@glidejs/glide/package.json
fix the problem
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Error [ERR_REQUIRE_ESM]: Must use import to load ES ...
I just installed the library onto my TypeScript project and I get the following error: Error [ERR_REQUIRE_ESM]: Must use import to load ES...
Read more >Error [ERR_REQUIRE_ESM]: require() of ES Module ... not ...
The current version of node-fetch is ONLY compatible with an ESM import (using import ), not from CommonJS modules using require() .
Read more >ECMAScript modules | Node.js v19.3.0 Documentation
Modules are defined using a variety of import and export statements. The following example of an ES module exports a function:
Read more >CommonJS vs. ES modules in Node.js - LogRocket Blog
Learn about the differences between CommonJS and ES modules when using them in Node.js applications to organize software code.
Read more >Import JSON in ES modules - Simon Plenderleith
Node.js now supports importing JSON files in ES modules *without* the ... backported in the next v16 (Active LTS) minor release (v16.15.0), ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jedrzejchalubek is it possible to add this feature so that we can use Glide with newer versions of Node ?
please see https://nodejs.org/api/packages.html#packagejson-and-file-extensions
thanks !
close with #623