question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSR:Error: ENOENT: no such file or directory, open 'xxx/src/views/module.tsx'

See original GitHub issue

Describe the bug

in ssr render fail. error info:

error info
Pre-bundling dependencies:
vue
vue-router
vue-decorator
(this will be run only when your dependencies or config have changed)
[Error: ENOENT: no such file or directory, open 'USERPATH/src/views/module.tsx'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'USERPATH/src/views/module.tsx'
}
Error: Couldn't resolve component "default" at "/"
at USERPATH/node_modules/vue-router/dist/vue-router.cjs.js:1996:47
at async render (USERPATH/src/entry-server.ts:8:4)

Reproduction

bug store: https://github.com/KellerLong/vue-fix

System Info

windows(wsl 1.0) Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:

npx: installed 1 in 2.328s

 
  System:
    OS: Linux 4.4 Ubuntu 18.04.2 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 3.69 GB / 15.90 GB
    Container: Yes
    Shell: 5.4.2 - /usr/bin/zsh
  Binaries:
    Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
    Yarn: 1.22.4 - ~/.nvm/versions/node/v12.13.0/bin/yarn
    npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
  npmPackages:
    @vitejs/plugin-vue: ^1.2.1 => 1.2.1
    vite: ^2.2.1 => 2.2.1

Used package manager: yarn

Logs

babelHelpers: ‘bundled’ option was used by default. It is recommended to configure this option explicitly, read more here: https://github.com/rollup/plugins/tree/master/packag es/babel#babelhelpers babelHelpers: ‘bundled’ option was used by default. It is recommended to configure this option explicitly, read more here: https://github.com/rollup/plugins/tree/master/packag es/babel#babelhelpers Pre-bundling dependencies: vue vue-router vue-decorator (this will be run only when your dependencies or config have changed) [Error: ENOENT: no such file or directory, open ‘/mnt/c/Users/kevin/Projects/test/vue-fix/src/views/module.tsx’] { errno: -2, code: ‘ENOENT’, syscall: ‘open’, path: ‘/mnt/c/Users/kevin/Projects/test/vue-fix/src/views/module.tsx’ } Error: Couldn’t resolve component “default” at “/” at /mnt/c/Users/kevin/Projects/test/vue-fix/node_modules/vue-router/dist/vue-router.cjs.js:1998:47 at async render (/mnt/c/Users/kevin/Projects/test/vue-fix/src/entry-server.ts:8:10) at async /mnt/c/Users/kevin/Projects/test/vue-fix/server/app.js:36:29



Before submitting the issue, please make sure you do the following

  • [ *] Read the Contributing Guidelines.
  • [ *] Read the docs.
  • [ *] Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
  • [ *] Provide a description in this issue that describes the bug.
  • [ *] Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
  • [ *] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
KellerLongcommented, May 5, 2021

expectation: acceleration,Come on, gogogo

2reactions
KellerLongcommented, May 6, 2021

This problem is not the cause of vite, it is the cause of typescript configuration, because jsx-vue does not support decorators and adds typescript and babel plugins. In fact, vite itself supports ts and babel, so you only need to add babel to decorators. Just support it. No need to introduce additional typescript plugins

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found