Can't import workbox in typescript tests
See original GitHub issueHello, I can’t import worktop
in a test because it loads .mjs
files and I have no idea how to load .mjs
with typescript files. I use node-tap
as test runner. Maybe it’s possible to fix it with https://nodejs.org/api/packages.html#packages_conditional_exports
.../node_modules/worktop/request/index.mjs:18
src/routes/foo.test.ts 2> export {
SyntaxError: Unexpected token 'export'
package.json
"scripts": {
"test": "tap --ts",
},
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Paths mapping between typescript and jest is not working at all
In tested file I have: import { TopBar, Slider, Player, NotLogged, LoadingIndicator, Message } from "components";. And error is. Cannot find ...
Read more >Building a Service Worker with Workbox 5, TypeScript ...
I won't be explaining how the service worker is integrated into the Angular app; I'll leave that for a later post. If you...
Read more >Build a progressive web app (PWA) with React - LogRocket Blog
This builds you a React web app built with TypeScript with support for PWA out of the box. It can be tested locally...
Read more >How to Make your React App a Progressive Web App (PWA)
Explaining the most important concepts around PWAs followed by a step by step tutorial, using Webpack, Workbox and TypeScript.
Read more >@kanaye/service-worker-webpack-plugin - npm
import workboxPrecaching from 'workbox-precaching'; // import the manifest from the virtual module import resources from '#serviceworker-virtual ...
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
Cool, will do 👍 I’m likely to extract this register script into its own package since I’ve needed it a number of times.
Yeah, that’s the missing part of the
bin/*.js
scripts. I don’t have sourcemap support in here yet but it should be fairly straightforward. TBH that’s the missing piece before actually extracting this as a separate module.