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

Can't run playground preserve-symlinks on windows #5242

Closed
7 tasks done
beicause opened this issue Oct 9, 2021 · 1 comment
Closed
7 tasks done

Can't run playground preserve-symlinks on windows #5242

beicause opened this issue Oct 9, 2021 · 1 comment

Comments

@beicause
Copy link

beicause commented Oct 9, 2021

Describe the bug

when I run test or vite in preserve-symlinks directory, a syntax error occurs in linked.js and build fails.

Reproduction

this repository, run pnpm dev in packages/playground/preserve-symlinks

System Info

System:
    OS: Windows 10 10.0.19041
    CPU: (16) x64 AMD Ryzen 7 4800U with Radeon Graphics
    Memory: 7.51 GB / 14.87 GB
  Binaries:
    Node: 16.10.0 - D:\ide\node\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.0.0 - D:\ide\node\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1023.0), Chromium (94.0.992.38)
    Internet Explorer: 11.0.19041.1202

Used Package Manager

pnpm

Logs

vite:config no config file found. +0ms
  vite:config using resolved config: {
  vite:config   root: 'D:/code/WebstromProjects/vite/packages/playground/preserve-symlinks',
  vite:config   base: '/',
  vite:config   mode: 'development',
  vite:config   configFile: undefined,
  vite:config   logLevel: undefined,
  vite:config   clearScreen: undefined,
  vite:config   server: { force: true, fs: { strict: undefined, allow: [Array] } },
  vite:config   configFileDependencies: [],
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     server: { force: true, fs: [Object] }
  vite:config   },
  vite:config   resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
  vite:config   publicDir: 'D:\\code\\WebstromProjects\\vite\\packages\\playground\\preserve-symlinks\\public',
  vite:config   cacheDir: 'D:\\code\\WebstromProjects\\vite\\packages\\playground\\preserve-symlinks\\node_modules\\.vite',
  vite:config   command: 'serve',
  vite:config   isProduction: false,
  vite:config   plugins: [
  vite:config     'vite:pre-alias',
  vite:config     'alias',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-script-proxy',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:client-inject',
  vite:config     'vite:import-analysis'
  vite:config   ],
  vite:config   build: {
  vite:config     target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     polyfillModulePreload: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {},
  vite:config     minify: 'esbuild',
  vite:config     terserOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  vite:config   },
  vite:config   env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   createResolver: [Function: createResolver],
  vite:config   optimizeDeps: {
  vite:config     esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  vite:config   }
  vite:config } +6ms
  vite:deps Crawling dependencies using entries:
  vite:deps   D:/code/WebstromProjects/vite/packages/playground/preserve-symlinks/index.html +0ms
  vite:resolve 1.04ms /src/main.js -> D:/code/WebstromProjects/vite/packages/playground/preserve-symlinks/src/main.js +0ms
  vite:resolve 4.12ms @symlinks/moduleA -> D:/code/WebstromProjects/vite/packages/playground/preserve-symlinks/moduleA/linked.js +7ms
 > moduleA/linked.js:1:0: error: Unexpected "."
    1 │ ./src/index.js
      ╵ ^

error when starting dev server:
Error: Build failed with 1 error:
moduleA/linked.js:1:0: error: Unexpected "."
    at failureErrorWithLog (D:\code\WebstromProjects\vite\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:1493:15)
    at D:\code\WebstromProjects\vite\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:1151:28
    at runOnEndCallbacks (D:\code\WebstromProjects\vite\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:941:63)
    at buildResponseToResult (D:\code\WebstromProjects\vite\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:1149:7)
    at D:\code\WebstromProjects\vite\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:1258:14
    at D:\code\WebstromProjects\vite\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:629:9
    at handleIncomingPacket (D:\code\WebstromProjects\vite\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:726:9)
    at Socket.readFromStdout (D:\code\WebstromProjects\vite\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:596:7)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)

Validations

@dominikg
Copy link
Contributor

dominikg commented Feb 8, 2022

what's the output of git config core.symlinks in your vite clone?

Got the same error on a windows VM and found that somehow i had core.symlinks false.

to fix it, run the following after you commited/stashed any unsaved changes

git config core.symlinks true
git reset --hard HEAD

@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants