Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES Module - SvelteKit project #11

Open
CaffeinatedTech opened this issue Oct 13, 2023 · 0 comments
Open

ES Module - SvelteKit project #11

CaffeinatedTech opened this issue Oct 13, 2023 · 0 comments

Comments

@CaffeinatedTech
Copy link

Hey there,

I'm implementing your 3d dice module into a static SvelteKit project, and have hit the following error adding the DisplayResults module.

(node:5057) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
08:36:11 [vite] Error when evaluating SSR module /src/routes/game/+page.svelte: failed to import "@3d-dice/dice-ui"
|- /home/adam/projects/dice-party/node_modules/.pnpm/@[email protected]/node_modules/@3d-dice/dice-ui/src/index.js:1
export { default as DisplayResults } from './displayResults'
^^^^^^

SyntaxError: Unexpected token 'export'
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1153:20)
    at Module._compile (node:internal/modules/cjs/loader:1197:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:165:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:192:25)
    at async DefaultModuleLoader.import (node:internal/modules/esm/loader:228:24)
    at async nodeImport (file:///home/adam/projects/dice-party/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-df561101.js:56019:17)

I tried a dirty fix of just adding "type": "module", to the package.json, but that brought about some other errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant