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

failed to load config from vite.config.js error when starting dev server #104

Closed
sophiamersmann opened this issue Jul 20, 2021 · 3 comments

Comments

@sophiamersmann
Copy link

Describe the bug

Failed to load config from vite.config.js error when starting dev server.
I did see #59 but an error persists.

Reproduction

npm init vite@latest vite-svelte-test --template svelte

cd vite-svelte-test
npm install
npm run dev

Logs

failed to load config from /Users/sfm17/software/personal/vite-svelte-test/vite.config.js
error when starting dev server:
file:///Users/sfm17/software/personal/vite-svelte-test/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:800
import { diff_match_patch, DIFF_DELETE, DIFF_INSERT } from "diff-match-patch";
                           ^^^^^^^^^^^
SyntaxError: The requested module 'diff-match-patch' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
For example:
import pkg from 'diff-match-patch';
const { diff_match_patch, DIFF_DELETE, DIFF_INSERT } = pkg;
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:97:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:135:5)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async loadConfigFromFile (/Users/sfm17/software/personal/vite-svelte-test/node_modules/vite/dist/node/chunks/dep-11db14da.js:75342:31)
    at async resolveConfig (/Users/sfm17/software/personal/vite-svelte-test/node_modules/vite/dist/node/chunks/dep-11db14da.js:74965:28)
    at async createServer (/Users/sfm17/software/personal/vite-svelte-test/node_modules/vite/dist/node/chunks/dep-11db14da.js:73483:20)
    at async CAC.<anonymous> (/Users/sfm17/software/personal/vite-svelte-test/node_modules/vite/dist/node/cli.js:13959:24)

System Info

System:
    OS: macOS 11.4
    CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
    Memory: 1.44 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.4.0 - /usr/local/bin/node
    npm: 6.14.4 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 91.1.26.74
    Chrome: 91.0.4472.164
    Firefox: 88.0.1
    Firefox Developer Edition: 91.0
    Safari: 14.1.1
  npmPackages:
    @sveltejs/vite-plugin-svelte: ^1.0.0-next.11 => 1.0.0-next.13
    svelte: ^3.37.0 => 3.38.3
    vite: ^2.4.2 => 2.4.2

Severity

blocking all usage of vite-plugin-svelte

@sophiamersmann sophiamersmann added bug Something isn't working triage Awaiting triage by a project member labels Jul 20, 2021
@dominikg
Copy link
Member

Can't reproduce with the steps provided.

I notice that you are using an outdated version of node 14 (14.4.0). Please update it and try again.
vite-plugin-svelte requires "node": "^12.20 || ^14.13.1 || >= 16"

If it still fails and you did any modification to the template after creating it, please provide a repository with them.

@sophiamersmann
Copy link
Author

That was it! Thanks and sorry for the inconvience!

@dominikg dominikg removed bug Something isn't working triage Awaiting triage by a project member labels Jul 23, 2021
@limbodan
Copy link

how to check systeminfo on windows project,please

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

3 participants