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.

Throws when compiling (recording phase): "Path variable [name] not implemented in this context"

See original GitHub issue

I tried upgrading by code from 1.x to 2.x. Unfortunately it does not work that well out of the box.

Stack Trace:

/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/webpack/lib/TemplatedPathPlugin.js:71 .replace(REGEXP_NAME, getReplacer(chunkName)) ^ Error: Path variable [name] not implemented in this context: [name].css at /Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/webpack/lib/TemplatedPathPlugin.js:48:26 at String.replace (<anonymous>) at MainTemplate.replacePathVariables (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/webpack/lib/TemplatedPathPlugin.js:71:4) at MainTemplate.applyPluginsWaterfall (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/tapable/lib/Tapable.js:91:24) at Compilation.getPath (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/webpack/lib/Compilation.js:1283:28) at /Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/extract-css-chunks-webpack-plugin/index.js:360:22 at getFile (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/extract-css-chunks-webpack-plugin/index.js:355:49) at ExtractTextPlugin.<anonymous> (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/extract-css-chunks-webpack-plugin/index.js:338:17) at Array.forEach (native) at ExtractTextPlugin.<anonymous> (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/extract-css-chunks-webpack-plugin/index.js:326:20) at Compilation.applyPluginsAsyncSeries (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/tapable/lib/Tapable.js:142:13) at sealPart2 (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/webpack/lib/Compilation.js:636:9) at next (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/tapable/lib/Tapable.js:138:11) at Compilation.compilation.plugin (/Users/Sebastian/Workspace/sebastian-software/edge-builder/src/plugins/VerboseProgress.js:1:2270) at next (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/tapable/lib/Tapable.js:140:14) at ExtractTextPlugin.<anonymous> (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/extract-css-chunks-webpack-plugin/index.js:301:5) at /Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/async/dist/async.js:421:16 at iteratorCallback (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/async/dist/async.js:998:13) at /Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/async/dist/async.js:906:16 at /Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/extract-css-chunks-webpack-plugin/index.js:284:6 at /Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/async/dist/async.js:421:16 at iteratorCallback (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/async/dist/async.js:998:13) at /Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/async/dist/async.js:906:16 at /Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/extract-css-chunks-webpack-plugin/index.js:274:9 at rebuilding.forEach.cb (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/webpack/lib/Compilation.js:504:29) at Array.forEach (native) at callback (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/webpack/lib/Compilation.js:504:15) at processModuleDependencies (/Users/Sebastian/Workspace/sebastian-software/edge-builder/node_modules/webpack/lib/Compilation.js:523:5)

My configuration is pretty straightforward for the plugin:

      isClient ? new ExtractCssChunks({
        filename: isDevelopment ? "[name].css" : "[name].[contenthash:base62:8].css"
      }) : null,

Do you have any idea why this is happening?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:73 (57 by maintainers)

github_iconTop GitHub Comments

1reaction
swernerxcommented, Jul 18, 2017

I am watching this PR, too 😃

1reaction
faceyspaceycommented, Jul 18, 2017

yea, you need to provide the options still. react-loadable’s latest babel plugin replaces the need for all that.

…truth is, another plugin that does what dual-import does and what react-loadable’s babel plugin does is coming out any day now:

https://github.com/faceyspacey/babel-plugin-universal-import

and a few other things. FYI, if you get what you have working, the transition will be seamless.

…dont try to use that plugin. it requires the @next dist-tag of react-universal-component. u could, but i gotta revisit before i launch. it’s been sitting on the vine for a while. there’s actually a PR to webpack i’m working on pushing through to make dynamic imports work universally. things are about to come together nicely.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Path variable [contenthash] not implemented in this context ...
Try to write filename: "[name].[contenthash].bundle.js" in the filename field. – DoneDeal0. Oct 19, 2021 at 14:59.
Read more >
Jenkins User Handbook
This chapter will lead you through installing an instance of Jenkins on a system for learning purposes and understanding basic Jenkins concepts.
Read more >
Spring Boot Reference Documentation
Try the How-to documents. They provide solutions to the most common questions. Learn the Spring basics. Spring Boot builds on many other Spring...
Read more >
Apache Tomcat 9 (9.0.70) - Changelog
Fix: Correct handling of HTTP TRACE requests where there are multiple instances of an HTTP header with the same name. · Fix: Implement...
Read more >
gcc(1) - Linux manual page - man7.org
The gcc program accepts options and file names as operands. ... -E Stop after the preprocessing stage; do not run the compiler proper....
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