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

Cant resolve .linariacache #278

Closed
vladmelnikov opened this issue Dec 5, 2018 · 5 comments
Closed

Cant resolve .linariacache #278

vladmelnikov opened this issue Dec 5, 2018 · 5 comments
Labels
needs: more info ℹ Not enough information was provided to work on issue

Comments

@vladmelnikov
Copy link

Do you want to request a feature or report a bug?
bug

What is the current behavior?
webpack throws error
Can't resolve 'C:my-project.linaria-cachesrcApp.linaria.css' in 'C:\my-project\src'
configuration
.babelrc
{ "presets": [ "@babel/preset-env", "@babel/preset-typescript", "@babel/preset-react", "linaria/babel" ], "plugins": [ ["@babel/plugin-proposal-decorators", { "legacy": true }], ["@babel/plugin-proposal-class-properties", { "loose": true }], "react-hot-loader/babel" ] }
rules for webpack
{ test: /\.css$/, use: [ { loader: 'style-loader' }, { loader: 'css-loader', options: { sourceMap: !isProd, }, }, ], }, { test: /\.(j|t)sx?$/, exclude: /node_modules/, use: [ { loader: 'babel-loader' }, { loader: 'linaria/loader', options: { sourceMap: !isProd }, } ]

"linaria": "^1.0.0-beta.0"
"webpack": "^4.23.1",

OS - windows 10

@satya164
Copy link
Member

satya164 commented Jan 6, 2019

I don't have a windows machine to test unfortunately :(
Do you use WSL?

@zamotany zamotany added the needs: more info ℹ Not enough information was provided to work on issue label Jan 7, 2019
@zamotany
Copy link
Contributor

zamotany commented Jan 7, 2019

@satya164 I don't WSL is used here, if you look at the paths: 'C:my-project.linaria-cachesrcApp.linaria.css' in 'C:\my-project\src', with WSL they would look much different. My bet is that the original error is

Can't resolve 'C:\my-project\.linaria-cache\src\App.linaria.css' in 'C:\my-project\src'

@ghost
Copy link

ghost commented Jan 7, 2019

Having the same issue. Is it maybe the : in Windows paths resulting in invalid module names here?

@satya164
Copy link
Member

satya164 commented Jan 7, 2019

Maybe it's how Webpack handles absolute paths on Windows? From this issue, looks like we need to escape the slashes: webpack/webpack#66

So we need to insert: C:\\my-project\\.linaria-cache\\src\\App.linaria.css instead of C:\my-project\.linaria-cache\src\App.linaria.css.

Can you try this branch and tell me if it works @mfarhadpur? https://github.com/callstack/linaria/tree/%40satya164/win-path

@ghost
Copy link

ghost commented Jan 7, 2019

@satya164 Yes, seems to be working fine. Thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: more info ℹ Not enough information was provided to work on issue
Projects
None yet
Development

No branches or pull requests

3 participants