Closed
Description
[REQUIRED] Describe your environment
- Operating System version: Mac OS 11.5.1
- Browser version: Chrome
- Firebase SDK version: 9.0.0-beta.8
- Firebase Product: messaging
[REQUIRED] Describe the problem
When I try to import the service worker version of getMessaging
:
import { getMessaging } from 'firebase/messaging/sw';
Webpack gives me the following error:
ERROR in ./node_modules/firebase/messaging/sw/dist/index.esm.js 1:0-75
Module not found: Error: Can't resolve '@firebase/messaging/sw' in '/Users/jhuleatt/git/fcm-v9-repro/node_modules/firebase/messaging/sw/dist'
Did you mean 'index.sw.esm2017.js'?
Steps to reproduce:
- Clone https://github.com/jhuleatt/fcm-v9-repro
src/firebase-messaging-sw.js
contains theimport
statementwebpack.config.js
contains a very basic webpack config
- Run
npm install
- Run
npm run build
- You'll see that
src/index.js
compiles without error, butsrc/firebase-messaging-sw.js
gives the above error.