3d-dice / dice-box

3D Game Dice for any JavaScript App
https://fantasticdice.games/
MIT License
137 stars 30 forks source link

Build error on Vite + Remix in a Linux production server #112

Closed Meolocious closed 3 months ago

Meolocious commented 3 months ago

Hi, I've got this issue from Vite while building my project based on Remix framework while using '@3d-dice/dice-box'

Build failed in 9.33s [vite]: Rollup failed to resolve import "@3d-dice/dice-box" from "/XXX". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to build.rollupOptions.external at viteWarn (file:///XXX/node_modules/vite/dist/node/chunks/dep-BcXSligG.js:65810:17) at onwarn (/AU-FE-Dashboard/node_modules/@remix-run/dev/dist/vite/plugin.js:618:13) at onRollupWarning (file:///XXX/node_modules/vite/dist/node/chunks/dep-BcXSligG.js:65843:5) at onwarn (file:///XXX/node_modules/vite/dist/node/chunks/dep-BcXSligG.js:65505:7) at file:///AU-FE-Dashboard/node_modules/rollup/dist/es/shared/node-entry.js:18514:13 at Object.logger [as onLog] (file:///AU-FE-Dashboard/node_modules/rollup/dist/es/shared/node-entry.js:20162:9) at ModuleLoader.handleInvalidResolvedId (file:///AU-FE-Dashboard/node_modules/rollup/dist/es/shared/node-entry.js:19104:26) at file:///AU-FE-Dashboard/node_modules/rollup/dist/es/shared/node-entry.js:19062:26

I'm importing it in the file I'm using in this way:

import DiceBox from '@3d-dice/dice-box';

and due to I'm on a typescript env I've declared the module with .d.ts file so on this side everything is goode got the error I shaerd before.

I tried also other solutions suggested like "externalize this module explicitly add it to build.rollupOptions.external" but it only let my server explode with 100% CPU usage costantly and a good 502 error. I'm stuck into this since the last 8h and I don't really know how to proceed.

Thank you

Meolocious commented 3 months ago

The issue was inside my server, so I closed the issue