[ERROR] svelte.config.cjs should be renamed to svelte.config.js and converted to an ES module
See original GitHub issueDescribe the bug - Log svelte.config.cjs should be renamed to svelte.config.js and converted to an ES module. See https://kit.svelte.dev/docs#configuration for an example
To Reproduce This is the weirdest issue ever i got i installed this https://github.com/SharifClick/svelte-swipe its giving me the error below
i delete its it same , i remove all .svelte and node_modules , still same error 😭
Expected behavior its should not throw any error, after removeing all the node_modules + .svelte , and install package.json again
Stack trace
> svelte-kit dev
svelte.config.cjs should be renamed to svelte.config.js and converted to an ES module. See https://kit.svelte.dev/docs#configuration for an example
No "exports" main defined in /study/spacefoot/xxxxxxxxxx/node_modules/@sveltejs/adapter-node/package.json
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /study/spacefoot/xxxxxxxxxx/node_modules/@sveltejs/adapter-node/package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:290:9)
at packageExportsResolve (internal/modules/esm/resolve.js:479:7)
at resolveExports (internal/modules/cjs/loader.js:432:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/study/spacefoot/xxxxxxxxxx/svelte.config.cjs:2:17)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
Information about your SvelteKit Installation:
Diagnostics
System:
OS: Linux 4.19 Debian GNU/Linux 10 (buster) 10 (buster)
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 2.62 GB / 7.71 GB
Container: Yes
Shell: 5.0.3 - /bin/bash
Binaries:
Node: 14.16.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/bin/yarn
npm: 6.14.11 - /usr/local/bin/npm
Browsers:
Chromium: 90.0.4430.93
npmPackages:
@sveltejs/kit: ^1.0.0-next.92 => 1.0.0-next.99
svelte: ^3.38.1 => 3.38.2
vite: ^2.2.3 => 2.2.4
- Your adapter (e.g. Node, static, Vercel, Begin, etc…) node
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Alternative to loading svelte.config.js ? · Issue #6 - GitHub
js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename...
Read more >Error in svelte.config.js Syntax Error: Cannot use import ...
You're likely not using "type": "module" in your package.json ... I fixed the issue by setting up Svelte Language-server: Runtime on VSCode.
Read more >Configuration • Docs • SvelteKit
Your project's configuration lives in a svelte.config.js file at the root of your project. As well as SvelteKit, this config object is used...
Read more >How to Set Up SvelteKit with Tailwind CSS
A quick 3 step guide for myself on how to set up Svelte with Tailwind CSS.
Read more >https://unpkg.com/@sveltejs/vite-plugin-svelte@1.0...
__esModule && "default" in module2 ? ... existsSync(abolutePath)) { throw new Error(`failed to find svelte config file ${abolutePath}.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The FAQ shows how to do this
You need to rename your config file, rewrite it with ESM imports/exports, and update the version of the adapter you’re using.