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.

[Bug Report][3.0.0-alpha.9][SSR] Cannot find module 'vuetify/lib/components'

See original GitHub issue

Environment

Vuetify Version: 3.0.0-alpha.9 Vue Version: 3.0.11 Browsers: Chrome 91.0.4472.102 OS: Chromium OS 13904.55.0

Steps to reproduce

  1. yarn install
    
  2. yarn dev
    
  3. Go to https://localhost:3000

Expected Behavior

No error is thrown.

Actual Behavior

Error is thrown:

Error: Cannot find module 'vuetify/lib/components' from '/home/brillout/tmp/vuetify3-ssr/pages/_default'
    at Function.resolveSync [as sync] (/home/brillout/tmp/vuetify3-ssr/node_modules/resolve/lib/sync.js:107:15)
    at resolveFrom$3 (/home/brillout/tmp/vuetify3-ssr/node_modules/vite/dist/node/chunks/dep-11db14da.js:4076:29)
    at resolve (/home/brillout/tmp/vuetify3-ssr/node_modules/vite/dist/node/chunks/dep-11db14da.js:73358:22)
    at nodeRequire (/home/brillout/tmp/vuetify3-ssr/node_modules/vite/dist/node/chunks/dep-11db14da.js:73337:25)
    at ssrImport (/home/brillout/tmp/vuetify3-ssr/node_modules/vite/dist/node/chunks/dep-11db14da.js:73290:20)
    at eval (/pages/_default/vuetify.js:9:31)
    at instantiateModule (/home/brillout/tmp/vuetify3-ssr/node_modules/vite/dist/node/chunks/dep-11db14da.js:73323:166)

Reproduction Link

https://github.com/brillout/vuetify3-ssr

Other comments

Hi, is vuetify supposed to work with SSR and Vite?

Trying to use Vuetify + Vite + SSR leads to an error where the npm package resolve cannot find vuetify/lib/components.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
KaelWDcommented, Sep 4, 2021

Alpha 11 now uses package exports, so you should be able to import from vuetify/components without an extension.

3reactions
KaelWDcommented, Jul 19, 2021

That was for the dev environment which imports from src. To get prod working with vite you might have to change the import to vuetify/lib/components/index.mjs. I’ll see if adding package exports makes it work without the extension.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >
MBed terminates on start [Cannot find module 'eventemitter2']
Running on a 64 bit linux system. Running through console spits these errors. Error: Cannot find module 'eventemitter2' Require stack: ...
Read more >
cannot find module 'vuex' or its corresponding type ...
I re-installed every package changed many settings but it still fails to load all paths and show the error above for all files....
Read more >
998358 – can not run npm: Cannot find module 'inherits'
Description of problem: $ npm module.js:340 throw err; ^ Error: Cannot find module 'inherits' at Function.Module.
Read more >
Cannot find module 'node-sass' - Visual Studio Feedback
Suddenly the builds stopped working. ERROR in ./src/global.scss Module build failed (from ./node_modules/mini-css-extract-plugin/dist/ ...
Read more >

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