You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error when loading "--template": svgr-template.mjs
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/karl/development/neo4j/needle-2/packages/react/svgr-template.mjs not supported.
Instead change the require of /Users/karl/development/neo4j/needle-2/packages/react/svgr-template.mjs to a dynamic import() which is available in all CommonJS modules.
at Option.parseArg (/Users/karl/development/neo4j/needle-2/node_modules/@svgr/cli/dist/index.js:330:22)
at handleOptionValue (/Users/karl/development/neo4j/needle-2/node_modules/@svgr/cli/node_modules/commander/lib/command.js:539:24)
at Command.<anonymous> (/Users/karl/development/neo4j/needle-2/node_modules/@svgr/cli/node_modules/commander/lib/command.js:566:7)
at Command.emit (node:events:514:28)
at Command.parseOptions (/Users/karl/development/neo4j/needle-2/node_modules/@svgr/cli/node_modules/commander/lib/command.js:1454:18)
at Command._parseCommand (/Users/karl/development/neo4j/needle-2/node_modules/@svgr/cli/node_modules/commander/lib/command.js:1240:25)
at Command.parse (/Users/karl/development/neo4j/needle-2/node_modules/@svgr/cli/node_modules/commander/lib/command.js:909:10)
at Object.<anonymous> (/Users/karl/development/neo4j/needle-2/node_modules/@svgr/cli/dist/index.js:398:19)
at Object.<anonymous> (/Users/karl/development/neo4j/needle-2/node_modules/@svgr/cli/bin/svgr:3:1)
🚀 Feature Proposal
Support ESM templates.
Error when loading "--template": svgr-template.mjs
Currently the docs do show to use CJS: https://react-svgr.com/docs/custom-templates/#custom-index-template
Motivation
The future of JS is ESM, we should be moving away from CJS everywhere.
Example
Everything re-written from CJS to ESM.
Pitch
Less pain having to deal with CJS.
Slightly related to #707
Is this on the roadmap?
The text was updated successfully, but these errors were encountered: