TanStackT
TanStack15mo ago
8 replies
excited-coffee

Tanstack Start and CommonJS modules

Hello,

I have converted my project to Tanstack Start from Next.js, and it was a fantastic experience until I ran into this error in the terminal upon build and dev commands. I'm using yarn.

[8:19:53 PM] ERROR require() of ES Module /Users/mathias/GitHub/flowthings/node_modules/string-width/index.js from /Users/mathias/GitHub/flowthings/node_modules/wide-align/align.js not supported.
Instead change the require of index.js in /Users/mathias/GitHub/flowthings/node_modules/wide-align/align.js to a dynamic import() which is available in all CommonJS modules.

Instead change the require of index.js in node_modules/wide-align/align.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (node_modules/wide-align/align.js:2:19)

I tried adding resolutions to my package.json without any luck:

"resolutions": {
"string-width": "4.2.3"
}
}

How can I fix this error? The module is used by one of my dependencies. I suspect it to be my TipTap editor somewhere. It is hard to locate.
Was this page helpful?