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

cannot resolve module 'style' #222

Closed
silent-tan opened this issue Nov 4, 2016 · 6 comments
Closed

cannot resolve module 'style' #222

silent-tan opened this issue Nov 4, 2016 · 6 comments

Comments

@silent-tan
Copy link

silent-tan commented Nov 4, 2016

after init, I import a css in the main.js

// import base css
import './less/materialize.css';

but make error:

ERROR in ./src/main.js
Module not found: Error: Cannot resolve module 'style' in /home/farzer/Documents/git-project/bolecity/src
 @ ./src/main.js 15:0-33

and following is my devDependencies:

I don not change the webpack config

thanks for all help

@luventa
Copy link

luventa commented Nov 4, 2016

need to import css in style node in your entry vue file of app.
for example
in App.vue
<style>@import your css file</style>

@silent-tan
Copy link
Author

@luventa

more error:

ERROR in ./~/css-loader!./~/vue-loader/lib/style-rewriter.js?id=data-v-dba0c600!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue
Module not found: Error: Cannot resolve module 'style' in /home/farzer/Documents/git-project/bolecity/src
 @ ./~/css-loader!./~/vue-loader/lib/style-rewriter.js?id=data-v-dba0c600!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 3:10-91

// App.vue

<style>
    @import "./assets/style/materialize.css";
</style>

@luventa
Copy link

luventa commented Nov 4, 2016

@farzer

I guess you need
npm install style-loader --save-dev

@silent-tan
Copy link
Author

sorry, it worked in a new vue project.
But thanks for help. 👍

@zigomir zigomir closed this as completed Nov 4, 2016
@reumia
Copy link

reumia commented Nov 30, 2016

i'm having same problems right now.

i set my project with vue-cli.
in first, there was no issues with import css files, but suddenly it happen.
i think it's not proper ways you've talked before. is there any good suggestions for this issue?

@silent-tan
Copy link
Author

@reumia sorry can not help you, I do not tangle too long on this issue, and no such problems later.

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

No branches or pull requests

4 participants