workbox-webpack-plugin build error with TypeScript and eval-cheap-source-map
See original GitHub issueWelcome! Please use this template for reporting bugs or requesting features. For questions about using Workbox, the best place to ask is Stack Overflow, tagged with [workbox]
: https://stackoverflow.com/questions/ask?tags=workbox
Library Affected: workbox-webpack-plugin
Browser & Platform: all browsers
Issue or Feature Request Description: When using workbox-webpack-plugin with TypeScript and eval-cheap-source-map, the following error is generated for the service worker and execution halts:
Uncaught SyntaxError: missing ) after argument list, line 25 of sw.js
This doesn’t happen with inline-source-map. I’ve been using this but it’s very slow.
Here is the webpack config bits:
module.exports = {
devtool: devMode ?
"eval-cheap-source-map" :
false,
...
module: {
rules: [
{
test: /\.(js|ts)$/,
use: {
loader: "ts-loader",
options: {
happyPackMode: true,
},
},
},
...
plugins: [
new InjectManifest({
swDest: "sw.js",
swSrc: "./src/sw.ts",
}),
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Gatsby 4 upgrade - typescript errors? Not using typescript
I'm getting these build errors and I don't know where to start! I'm not using gatsby-plugin-typescript. Thanks!
Read more >workbox-build 6.2.0-alpha.0 on Node.js NPM - NewReleases.io
The workbox-build module has been rewritten in TypeScript, following the earlier migration of the workbox-cli module. ( workbox-webpack-plugin has not yet ...
Read more >workbox-build: Versions - Openbase
We upgraded to TypeScript 4.4.3. · You can check the number of requests in the sync queue with the new method size() ....
Read more >Create a service worker with Workbox, Webpack and TypeScript
__WB_MANIFEST) . Anyway there's a problem: I want to cache some additional files during the installation process to be used to manage errors...
Read more >Troubleshooting Issues with the TypeScript SDK
Worker errors and logs are reflected in the terminal. If something isn't behaving the way you expect, make sure to check both locations...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @alexburlton-sonocent—all of the Workbox libraries are released concurrently (using
lerna
) and have matching version numbers.The fix for this issue was merged into the
v6
branch and will go live with the plannedv6.2.0
release of all of the Workbox libraries (includingworkbox-webpack-plugin
), which is unfortunately still blocked on a few more changes we plan on making.We don’t anticipate backporting this sort of change to the v5.x releases.
This issue is still occurring in my React 18 app on the latest workbox version (6.5.4). Here’s my webpack config file: