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
Hi! I am upgrading a gatsby v4 codebase to gatsby v5 with the intention of utilizing the ESM support introduced in v5.
I have somewhat uncommon setup, and I want to make use of Node.js subpath imports in the project. When I try to use one of these imports in gatsby-node.mjs, I get a vague syntax error:
SyntaxError: Invalid or unexpected token
- translators:119 ESMLoader.moduleStrategy
node:internal/modules/esm/translators:119:18
- loader:468 ESMLoader.moduleProvider
node:internal/modules/esm/loader:468:14
not finished load plugins - 0.542s
ELIFECYCLE Command failed with exit code 1.
Is this a feature that needs extra support from the Gatsby side, or is there some config I'm missing on the Gatsby side?
Thanks!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
TLDR: Does Gatsby v5 support Node.js subpath imports in
gatsby-*.mjs
files?Hi! I am upgrading a
gatsby v4
codebase togatsby v5
with the intention of utilizing the ESM support introduced in v5.I have somewhat uncommon setup, and I want to make use of Node.js subpath imports in the project. When I try to use one of these imports in
gatsby-node.mjs
, I get a vague syntax error:SyntaxError: Invalid or unexpected token - translators:119 ESMLoader.moduleStrategy node:internal/modules/esm/translators:119:18 - loader:468 ESMLoader.moduleProvider node:internal/modules/esm/loader:468:14 not finished load plugins - 0.542s ELIFECYCLE Command failed with exit code 1.
Is this a feature that needs extra support from the Gatsby side, or is there some config I'm missing on the Gatsby side?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions