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
Starting with a simple electron + web template for SvelteKit for experimentation. I tried adding yjs to it, but getting the error in Logs.
Works just fine in my non-sveltekit svelte app.
Reproduction
Clone https://github.com/nokola/testSvelteKit
Run:
yarn
yarn build
Expected: all OK Actual: build error:
> Using @sveltejs/adapter-static
(node:16116) 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)
import * as Y from 'yjs' // eslint-disable-line
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
at async Loader.import (internal/modules/esm/loader.js:166:24)
at async Object.load_component (file:///D:/Repos/Local/my-app/.svelte-kit/output/server/chunks/app-024aa19a.js:1503:13)
at async Promise.all (index 1)
(node:16116) UnhandledPromiseRejectionWarning: SyntaxError: Cannot use import statement outside a module
(node:16116) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled
promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:16116) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
> 500 /
Error: 500 /
at file:///D:/Repos/Local/my-app/node_modules/@sveltejs/kit/dist/chunks/index4.js:86:11
at visit (file:///D:/Repos/Local/my-app/node_modules/@sveltejs/kit/dist/chunks/index4.js:222:5)
at async prerender (file:///D:/Repos/Local/my-app/node_modules/@sveltejs/kit/dist/chunks/index4.js:303:6)
at async Object.prerender (file:///D:/Repos/Local/my-app/node_modules/@sveltejs/kit/dist/chunks/index4.js:368:4)
at async adapt (file:///D:/Repos/Local/my-app/node_modules/@sveltejs/adapter-static/index.js:13:4)
at async adapt (file:///D:/Repos/Local/my-app/node_modules/@sveltejs/kit/dist/chunks/index4.js:393:2)
at async file:///D:/Repos/Local/my-app/node_modules/@sveltejs/kit/dist/cli.js:896:5
Note: failure happens if yjs is used in any way, see index.svelte:
<script>
import * as S from "y-websocket"
S.test();
</script>
Logs
PS D:\Repos\GitHub\testSvelteKit> yarn build
yarn run v1.22.17
$ svelte-kit build
vite v2.6.14 building for production...
transforming (44) node_modules\lib0\conditions.js'test' is not exported by 'node_modules\y-websocket\src\y-websocket.js'
✓ 58 modules transformed.
.svelte-kit/output/client/_app/manifest.json 2.04 KiB
.svelte-kit/output/client/_app/pages/__layout.svelte-25daf92b.js 1.54 KiB / gzip: 0.78 KiB
.svelte-kit/output/client/_app/error.svelte-6be86a66.js 1.56 KiB / gzip: 0.75 KiB
.svelte-kit/output/client/_app/pages/index.svelte-e288b0c2.js 1.83 KiB / gzip: 0.94 KiB
.svelte-kit/output/client/_app/pages/page1.svelte-6e46b093.js 1.44 KiB / gzip: 0.72 KiB
.svelte-kit/output/client/_app/pages/page2.svelte-508cb7a1.js 1.48 KiB / gzip: 0.73 KiB
.svelte-kit/output/client/_app/pages/page3.svelte-06e9be0e.js 1.44 KiB / gzip: 0.72 KiB
.svelte-kit/output/client/_app/assets/start-61d1577b.css 0.16 KiB / gzip: 0.15 KiB
.svelte-kit/output/client/_app/assets/pages/__layout.svelte-118da309.css 0.68 KiB / gzip: 0.40 KiB
.svelte-kit/output/client/_app/start-0f28ad9d.js 18.94 KiB / gzip: 6.93 KiB
.svelte-kit/output/client/_app/assets/pages/index.svelte-1a7d65f4.css 0.32 KiB / gzip: 0.19 KiB
.svelte-kit/output/client/_app/chunks/vendor-d6b0b8d4.js 7.32 KiB / gzip: 2.99 KiB
vite v2.6.14 building SSR bundle for production...
✓ 21 modules transformed.
.svelte-kit/output/server/app.js 0.07 KiB
.svelte-kit/output/server/chunks/app-02114f6d.js 50.04 KiB
.svelte-kit/output/server/chunks/__layout-53c16722.js 0.60 KiB
.svelte-kit/output/server/chunks/error-b29df138.js 0.71 KiB
.svelte-kit/output/server/chunks/index-fb13d36b.js 1.30 KiB
.svelte-kit/output/server/chunks/page1-649e60b9.js 0.60 KiB
.svelte-kit/output/server/chunks/page2-575d970b.js 0.63 KiB
.svelte-kit/output/server/chunks/page3-422e4654.js 0.60 KiB
Run npm run preview to preview your production build locally.
> Using @sveltejs/adapter-static
(node:8212) 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)
D:\Repos\GitHub\testSvelteKit\node_modules\y-websocket\src\y-websocket.js:11
import * as Y from 'yjs' // eslint-disable-line
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
at async Loader.import (internal/modules/esm/loader.js:166:24)
at async Object.load_component (file:///D:/Repos/GitHub/testSvelteKit/.svelte-kit/output/server/chunks/app-02114f6d.js:1527:13)
at async Promise.all (index 1)
(node:8212) UnhandledPromiseRejectionWarning: SyntaxError: Cannot use import statement outside a module
(node:8212) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async functionwithout a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:8212) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
> 500 /
Error: 500 /
at file:///D:/Repos/GitHub/testSvelteKit/node_modules/@sveltejs/kit/dist/chunks/index4.js:86:11
at visit (file:///D:/Repos/GitHub/testSvelteKit/node_modules/@sveltejs/kit/dist/chunks/index4.js:222:5)
at async prerender (file:///D:/Repos/GitHub/testSvelteKit/node_modules/@sveltejs/kit/dist/chunks/index4.js:303:6)
at async Object.prerender (file:///D:/Repos/GitHub/testSvelteKit/node_modules/@sveltejs/kit/dist/chunks/index4.js:368:4)
at async adapt (file:///D:/Repos/GitHub/testSvelteKit/node_modules/@sveltejs/adapter-static/index.js:13:4)
at async adapt (file:///D:/Repos/GitHub/testSvelteKit/node_modules/@sveltejs/kit/dist/chunks/index4.js:393:2)
at async file:///D:/Repos/GitHub/testSvelteKit/node_modules/@sveltejs/kit/dist/cli.js:896:5
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS D:\Repos\GitHub\testSvelteKit>
Describe the bug
Starting with a simple electron + web template for SvelteKit for experimentation. I tried adding yjs to it, but getting the error in Logs.
Works just fine in my non-sveltekit svelte app.
Reproduction
https://github.com/nokola/testSvelteKit
Expected: all OK
Actual: build error:
Note: failure happens if yjs is used in any way, see index.svelte:
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: