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

Failed to load literal css from index.styl #1889

Open
1 task done
favoyang opened this issue Sep 25, 2019 · 4 comments
Open
1 task done

Failed to load literal css from index.styl #1889

favoyang opened this issue Sep 25, 2019 · 4 comments
Assignees
Labels
documentation Any issues related to documentation

Comments

@favoyang
Copy link
Contributor

  • I confirm that this is an issue rather than a question.

Bug report

Based on stylus lang docs,, literal css can be load via @import.

However, appending below line to theme/index.,styl, failed to compile.

@import "literal.css"

Steps to reproduce

https://github.com/favoyang/netlify-vuepress-test/tree/load-literal-css
(load-literal-css branch).

What is expected?

yarn docs:build should run without error.

What is actually happening?

Output: Module not found: Error: Can't resolve './literal.css'

$ yarn docs:build
yarn run v1.17.3
$ ./node_modules/.bin/vuepress build docs
wait Extracting site metadata...
tip Apply local theme at C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\docs\.vuepress\theme...
tip Apply theme local (extends @vuepress/theme-default) ...
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...
tip Apply plugin @vuepress/back-to-top (i.e. "@vuepress/plugin-back-to-top") ...
tip Apply plugin @vuepress/medium-zoom (i.e. "@vuepress/plugin-medium-zoom") ...
× Client
  Compiled with some errors in 14.38s
√ Server
  Compiled successfully in 7.70s
(undefined) ./node_modules/@vuepress/core/.temp/style.styl
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleNotFoundError: Module not found: Error: Can't resolve './literal.css' in 'C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\@vuepress\core\.temp'
    at factory.create (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\Compilation.js:925:10)
    at factory (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\NormalModuleFactory.js:401:22)
    at resolver (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\NormalModuleFactory.js:130:21)
    at asyncLib.parallel (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\NormalModuleFactory.js:224:22)
    at C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\neo-async\async.js:2830:7
    at C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\neo-async\async.js:6877:13
    at normalResolver.resolve (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\NormalModuleFactory.js:214:25)
    at doResolve (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\enhanced-resolve\lib\Resolver.js:184:12)
    at hook.callAsync (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\enhanced-resolve\lib\Resolver.js:238:5)
    at _fn0 (eval at create (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
    at resolver.doResolve (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:37:5)
    at hook.callAsync (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\enhanced-resolve\lib\Resolver.js:238:5)
    at _fn0 (eval at create (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
    at hook.callAsync (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\enhanced-resolve\lib\Resolver.js:238:5)
    at _fn0 (eval at create (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:27:1)
    at resolver.doResolve (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:42:38)
 @ ./node_modules/@vuepress/core/lib/node/internal-plugins/style/client.js 2:0-26
 @ ./node_modules/@vuepress/core/.temp/app-enhancers/0.js
 @ ./node_modules/@vuepress/core/.temp/internal/app-enhancers.js
 @ ./node_modules/@vuepress/core/lib/client/app.js
 @ ./node_modules/@vuepress/core/lib/client/clientEntry.js
 @ multi ./node_modules/@vuepress/core/lib/client/clientEntry.js
Error: Failed to compile with errors.
    at webpack (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\@vuepress\core\lib\node\build\index.js:186:16)
    at finalCallback (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\MultiCompiler.js:254:12)
    at runWithDependencies.err (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\MultiCompiler.js:277:6)
    at done (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\neo-async\async.js:2931:13)
    at runCompilers (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\MultiCompiler.js:181:48)
    at err (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\MultiCompiler.js:188:7)
    at compiler.run (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\MultiCompiler.js:270:7)
    at finalCallback (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\Compiler.js:257:39)
    at hooks.done.callAsync.err (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\Compiler.js:273:13)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:33:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\tapable\lib\Hook.js:154:20)
    at onCompiled (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\Compiler.js:271:21)
    at hooks.afterCompile.callAsync.err (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\Compiler.js:681:15)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\tapable\lib\Hook.js:154:20)
    at compilation.seal.err (C:\Users\mac\Documents\projects\openupm\netlify-vuepress-test\node_modules\webpack\lib\Compiler.js:678:31)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Other relevant information

  • Output of npx vuepress info in my VuePress project:
$ npx vuepress info

Environment Info:

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz
  Binaries:
    Node: 10.16.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.10.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.18362.329.0
  npmPackages:
    @vuepress/core:  1.1.0
    @vuepress/theme-default:  1.1.0
    vuepress: ^1.1.0 => 1.1.0
  npmGlobalPackages:
    vuepress: Not Found
@billyyyyy3320
Copy link
Collaborator

Apologies for the delayed response. index.styl will be imported by the file in temporary directory for client. Therefore, the .css file cannot be resolve with relative path.

But you're able to import/require stylus files because they'll probably be complied before that. In which scenario do you need to import literal css?

@billyyyyy3320 billyyyyy3320 added the need feedback Awaiting author response label Jan 30, 2020
@favoyang
Copy link
Contributor Author

@newsbielt703 thanks for the explanation. My intention is to import other CSS libraries and keep everything into the default theme stylus file. I managed to rename the CSS library to .styl, and load that instead.

I guess this is not considered as a bug, but a limitation of the system? Then I will close the issue.

@billyyyyy3320 billyyyyy3320 added documentation Any issues related to documentation and removed need feedback Awaiting author response labels Jan 31, 2020
@billyyyyy3320 billyyyyy3320 self-assigned this Jan 31, 2020
@billyyyyy3320
Copy link
Collaborator

Well, IMO, it needs to be docmented. Anyway, thanks for the report.

@favoyang
Copy link
Contributor Author

Okay I will leave this open. Feel free to close it when the documentation get updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Any issues related to documentation
Projects
None yet
Development

No branches or pull requests

2 participants