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

"SyntaxError: Unexpected identifier" when loading vite.config with @sveltejs/vite-plugin-svelte or vite-plugin-solid plugins #23

Open
5 tasks done
MellKam opened this issue Feb 19, 2023 · 0 comments

Comments

@MellKam
Copy link

MellKam commented Feb 19, 2023

Describe the bug

I encountered this error when using unocss vscode extention. I already opened issue in unocss repo unocss/unocss#2088.

When I try to load vite.config with @sveltejs/vite-plugin-svelte or vite-plugin-solid plugin i get this error.

/home/melkam/unconfig-bug/node_modules/.pnpm/vitefu@0.2.4_vite@4.0.4/node_modules/vitefu/src/index.js:15
    const { createRequire } = (await Promise.resolve().then(() => require('module'))).default;
                                     ^^^^^^^

SyntaxError: Unexpected identifier
    at new Script (node:vm:100:7)
    at createScript (node:vm:259:10)
    at Object.runInThisContext (node:vm:307:10)
    at jiti (/home/melkam/unconfig-bug/node_modules/.pnpm/jiti@1.16.2/node_modules/jiti/dist/jiti.js:5:24838)
    at /home/melkam/unconfig-bug/node_modules/.pnpm/vite-plugin-solid@2.5.0_solid-js@1.6.9+vite@4.0.4/node_modules/vite-plugin-solid/dist/esm/index.mjs:8:15
    at jiti (/home/melkam/unconfig-bug/node_modules/.pnpm/jiti@1.16.2/node_modules/jiti/dist/jiti.js:5:25030)
    at /home/melkam/unconfig-bug/vite.config.ts:2:47
    at jiti (/home/melkam/unconfig-bug/node_modules/.pnpm/jiti@1.16.2/node_modules/jiti/dist/jiti.js:5:25030)
    at loadConfigFile (file:///home/melkam/unconfig-bug/node_modules/.pnpm/unconfig@0.3.7/node_modules/unconfig/dist/index.mjs:145:11)
    at async Object.load (file:///home/melkam/unconfig-bug/node_modules/.pnpm/unconfig@0.3.7/node_modules/unconfig/dist/index.mjs:74:24)
    at async file:///home/melkam/unconfig-bug/test.ts:1:47

Reproduction

https://codesandbox.io/p/sandbox/unconfig-vite-solid-bug-2wrobj

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
    Memory: 6.14 GB / 7.74 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
    npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@MellKam MellKam changed the title "SyntaxError: Unexpected identifier" when loading @sveltejs/vite-plugin-svelte or vite-plugin-solid plugin "SyntaxError: Unexpected identifier" when loading vite.config with @sveltejs/vite-plugin-svelte or vite-plugin-solid plugin Feb 19, 2023
@MellKam MellKam changed the title "SyntaxError: Unexpected identifier" when loading vite.config with @sveltejs/vite-plugin-svelte or vite-plugin-solid plugin "SyntaxError: Unexpected identifier" when loading vite.config with @sveltejs/vite-plugin-svelte or vite-plugin-solid plugins Feb 19, 2023
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