TanStackT
TanStack4mo ago
3 replies
sacred-emerald

Start RC -> Failed to load the ES module

Hi, code that was working OK inside Start 1.31 is now showing an error in the logs.

https://68dcdf7e5058d6c68105c80c--momnium.netlify.app/

The strange thing is that if the page is loaded directly from the address bar it loads ok. But if I navigate to a route using a link, I get this error. But if I refresh it loads.

Log message:

Oct 1, 11:04:23 AM: 99aee44c ERROR (node:8) Warning: Failed to load the ES module: /var/task/node_modules/chartjs-plugin-dragdata/dist/chartjs-plugin-dragdata.esm.js. Make sure to set "type": "module" in the nearest package.json file or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
Oct 1, 11:04:23 AM: 99aee44c ERROR /var/task/node_modules/chartjs-plugin-dragdata/dist/chartjs-plugin-dragdata.esm.js:7
import{getRelativePosition as t}from"chart.js/helpers";import{Chart as n}from"chart.js";var e={value:()=>{}};function i(){for(var t,n=0,e=arguments.length,i={};n<e;++n){if(!(t=arguments[n]+"")||t in i||/[\s.]/.test(t))throw 

…

SyntaxError: Cannot use import statement outside a module
at wrapSafe (node:internal/modules/cjs/loader:1620:18)
at Module._compile (node:internal/modules/cjs/loader:1662:20)
at Object..js (node:internal/modules/cjs/loader:1820:10)
at Module.load (node:internal/modules/cjs/loader:1423:32)
at Function._load (node:internal/modules/cjs/loader:1246:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at cjsLoader (node:internal/modules/esm/translators:268:5)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:202:7)
at ModuleJob.run (node:internal/modules/esm/module_job:343:25),
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true
}


package.json already has type: "module"
Momnium provides advanced tools for track cycling training, race analysis, and equipment optimization. Also a blog packed with expert tips and insights.
Track Cycling Tools & Insights for Cyclists and Coaches
Was this page helpful?