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.

vite deep scan - can't import styles from node modules scoped npm pacakge

See original GitHub issue

edit: repo: https://github.com/lior-a/vite_issue/tree/master/cant_import_dist_style

|### Describe the bug

fail to import from node modules (during npm link of scope package) even though you can see that the file is explicitly exists in the node_modules and the path is 100% correct.

image

Reproduction

https://stackblitz.com/edit/vitejs-vite-peyhhn?file=main.js

System Info

https://stackblitz.com/edit/vitejs-vite-peyhhn?file=main.js



* note that i've created the node_modules manually and i think stackblitz just remove it or hide it somehow

Used Package Manager

npm

Logs

No response

Validations

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lior-acommented, May 30, 2022

@sapphi-red you right i missed that dist is gitignored (exists on my machine but not pushed.) i’ve changed it to output see commit https://github.com/lior-a/vite_issue/commit/2a7e1cc2e0632ba94db0ba12b58c2a71b67d9d37

but it still leave us with 2 imports that don’t work and 1 that does

0reactions
sapphi-redcommented, Jun 2, 2022

https://github.com/lior-a/vite_issue/blob/master/cant_import_dist_style/node_modules/%40test/package.json This file should be node_modules/@test/ui/package.json not node_modules/@test/package.json.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Vite
Vite has a list of "allowed conditions" and will match the first condition that is in the allowed list. The default allowed conditions...
Read more >
published vite vue 3 npm package have problem with styles
I can see style.css file in node-modules/my-package/dist/style.css But it can't be imported . How can I fix this ?
Read more >
vite-plugin-inline-css-modules - npm package - Snyk
This was originally written for writing styles in SolidJS. I came from Vue, which already contained a special <style scoped> tag, and I...
Read more >
equire is not defined in es module scope, you can use import ...
Environment · Operating System: Darwin · Node Version: v14.18.1 · Nuxt Version: 3.0.0-27245975.d1214c9 · Package Manager: Yarn · Bundler: Vite · User Config: ......
Read more >
@wordpress/scripts - npm
You only need to install one npm module: npm install @wordpress/scripts --save-dev. Note: This package requires Node.js 14.0.0 or later, ...
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