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
6:22:19 PM [vite] Error when evaluating SSR module C:\Users\onder\Desktop\node_apps\blog1\src\routes\index.json.js:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\onder\Desktop\node_apps\blog1\node_modules\to-vfile\index.js
require() of ES modules is not supported.
require() of C:\Users\onder\Desktop\node_apps\blog1\node_modules\to-vfile\index.js from C:\Users\onder\Desktop\node_apps\blog1\node_modules\vite\dist\node\chunks\dep-972722fa.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\onder\Desktop\node_apps\blog1\node_modules\to-vfile\package.json.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1080:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at nodeRequire (C:\Users\onder\Desktop\node_apps\blog1\node_modules\vite\dist\node\chunks\dep-972722fa.js:73811:17)
at ssrImport (C:\Users\onder\Desktop\node_apps\blog1\node_modules\vite\dist\node\chunks\dep-972722fa.js:73753:20)
at eval (C:\Users\onder\Desktop\node_apps\blog1\src\routes\index.json.js:6:37)
at async instantiateModule (C:\Users\onder\Desktop\node_apps\blog1\node_modules\vite\dist\node\chunks\dep-972722fa.js:73796:9)
Must use import to load ES Module: C:\Users\onder\Desktop\node_apps\blog1\node_modules\to-vfile\index.js
require() of ES modules is not supported.
require() of C:\Users\onder\Desktop\node_apps\blog1\node_modules\to-vfile\index.js from C:\Users\onder\Desktop\node_apps\blog1\node_modules\vite\dist\node\chunks\dep-972722fa.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\onder\Desktop\node_apps\blog1\node_modules\to-vfile\package.json.
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18) s\blog1\node_modules\to-vfile\index.js
at nodeRequire (C:\Users\onder\Desktop\node_apps\blog1\node_modules\vite\dist\node\chunks\dep-972722fa.js:73811:17) Users\onder\Desktop\node_apps\blog1\node_modules\vite\dist\node\chunks\dep-972722fa.js is an ES module file as
at ssrImport (C:\Users\onder\Desktop\node_apps\blog1\node_modules\vite\dist\node\chunks all .js files in that package scope as ES modules.\dep-972722fa.js:73753:20) e "type": "module" from C:\Users\onder\Desktop\node_apps\blog1\node_modules\to-vfile\package.json.
at eval (C:\Users\onder\Desktop\node_apps\blog1\src\routes\index.json.js:6:37)
at async instantiateModule (C:\Users\onder\Desktop\node_apps\blog1\node_modules\vite\dist\node\chunks\dep-972722fa.js:73796:9)
Unexpected token E in JSON at position 0
SyntaxError: Unexpected token E in JSON at position 0
at JSON.parse (<anonymous>)
at Proxy.<anonymous> (file:///C:/Users/onder/Desktop/node_apps/blog1/node_modules/@svelks\dep-972722fa.js:73811:17)tejs/kit/dist/ssr.js:923:22) \dep-972722fa.js:73753:20)
at async load (index.svelte:4:24)
at async load_node (file:///C:/Users/onder/Desktop/node_apps/blog1/node_modules/@sveltest\node\chunks\dep-972722fa.js:73796:9)js/kit/dist/ssr.js:951:12)
at async respond$1 (file:///C:/Users/onder/Desktop/node_apps/blog1/node_modules/@sveltejs/kit/dist/ssr.js:1235:15)
at async render_page (file:///C:/Users/onder/Desktop/node_apps/blog1/node_modules/@sveltejs/kit/dist/ssr.js:923:22)tejs/kit/dist/ssr.js:1399:19)
at async resolve (file:///C:/Users/onder/Desktop/node_apps/blog1/node_modules/@sveltejsjs/kit/dist/ssr.js:951:12)/kit/dist/ssr.js:1662:10) js/kit/dist/ssr.js:1235:15)
at async respond (file:///C:/Users/onder/Desktop/node_apps/blog1/node_modules/@sveltejstejs/kit/dist/ssr.js:1399:19)/kit/dist/ssr.js:1641:10) /kit/dist/ssr.js:1662:10)
at async Immediate.<anonymous> (file:///C:/Users/onder/Desktop/node_apps/blog1/node_mod/kit/dist/ssr.js:1641:10)ules/@sveltejs/kit/dist/chunks/index.js:3511:22)
Describe the bug
Importing a module gives error, even though not using it.
Reproduction
Here is the repo link: https://github.com/onderbakirtas/bug-report
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
Using it like this:
The text was updated successfully, but these errors were encountered: