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

SvelteKit fails to run if the repository path contains an apostrofe #77

Closed
Yummeh opened this issue Aug 4, 2023 · 0 comments · Fixed by #78
Closed

SvelteKit fails to run if the repository path contains an apostrofe #77

Yummeh opened this issue Aug 4, 2023 · 0 comments · Fixed by #78

Comments

@Yummeh
Copy link

Yummeh commented Aug 4, 2023

Describe the bug

When creating and running a bare project in a folder where an apostrofe is in the path it throws an import analysis error.

For example in a folder such as: D:\TestRepo's\svelte-app
Renaming the folder to remove the apostrofe will remove the error and allows the project to run again.

image

See logs for more information.

Reproduction

Any svelte-kit project where the pathname contains an apostrofe. Other characters were not tested.

Logs

23:48:26 [vite] Internal server error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
  Plugin: vite:import-analysis
  File: D:/TestRepo's/appie/.svelte-kit/generated/root.svelte:783:1015
  781|  }
  782|  
  783|  import * as ___SVELTE_HMR_HOT_API from 'D:/TestRepo's/appie/node_modules/svelte-hmr/runtime/hot-api-esm.js';import { adapter as ___SVELTE_HMR_HOT_API_PROXY_ADAPTER } from 'D:/TestRepo's/appie/node_modules/svelte-hmr/runtime/proxy-adapter-dom.js';if (import.meta && import.meta.hot) { if (false) import.meta.hot.acceptExports(['default']);; Root = ___SVELTE_HMR_HOT_API.applyHmr({ m: import.meta, id: "D:/TestRepo's/appie/.svelte-kit/generated/root.svelte", hotOptions: {"preserveLocalState":false,"noPreserveStateKey":["@hmr:reset","@!hmr"],"preserveAllLocalStateKey":"@hmr:keep-all","preserveLocalStateKey":"@hmr:keep","noReload":false,"optimistic":false,"acceptNamedExports":true,"acceptAccessors":true,"injectCss":false,"cssEjectDelay":100,"native":false,"importAdapterName":"___SVELTE_HMR_HOT_API_PROXY_ADAPTER","noOverlay":true,"allowLiveBinding":false,"partialAccept":true}, Component: Root, ProxyAdapter: ___SVELTE_HMR_HOT_API_PROXY_ADAPTER, acceptable: true, preserveLocalState: false, emitCss: true, }); }
     |





                                                        ^
  784|  export default Root;
  785|
      at formatError (file:///D:/TestRepo's/appie/node_modules/vite/dist/node/chunks/dep-75f53616.js:43944:46)
      at TransformContext.error (file:///D:/TestRepo's/appie/node_modules/vite/dist/node/chunks/dep-75f53616.js:43940:19)
      at TransformContext.transform (file:///D:/TestRepo's/appie/node_modules/vite/dist/node/chunks/dep-75f53616.js:41693:22)
      at async Object.transform (file:///D:/TestRepo's/appie/node_modules/vite/dist/node/chunks/dep-75f53616.js:44234:30)
      at async loadAndTransform (file:///D:/TestRepo's/appie/node_modules/vite/dist/node/chunks/dep-75f53616.js:54901:29)
      at async viteTransformMiddleware (file:///D:/TestRepo's/appie/node_modules/vite/dist/node/chunks/dep-75f53616.js:64296:32) (x2)

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
    Memory: 1.14 GB / 7.95 GB
  Binaries:
    Node: 16.20.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.19.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 115.0.5790.170
    Edge: Spartan (44.19041.1266.0), Chromium (115.0.1901.188)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    svelte: ^4.0.5 => 4.1.2

Severity

annoyance

@Conduitry Conduitry transferred this issue from sveltejs/svelte Aug 4, 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

Successfully merging a pull request may close this issue.

1 participant