Closed snimshchikov closed 2 months ago
they simply need to bump versions? this should be an issue on their repo, not here
The issue persists in the latest version of webrtc-polyfill
Steps to reproduce:
npm create t3-app@latest
o What will your project be called?
| test-polyfill
|
o Will you be using TypeScript or JavaScript?
| TypeScript
|
o Will you be using Tailwind CSS for styling?
| No
|
o Would you like to use tRPC?
| No
|
o What authentication provider would you like to use?
| None
|
o What database ORM would you like to use?
| None
|
o Would you like to use Next.js App Router?
| Yes
|
o Should we initialize a Git repository and stage the changes?
| No
|
o Should we run 'npm install' for you?
| Yes
|
o What import alias would you like to use?
| ~/
npm install webrtc-polyfill
import { RTCPeerConnection } from 'webrtc-polyfill'
if (3*3 === 4) new RTCPeerConnection()
npm run dev
Module not found: Default condition should be last one
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module: ./node_modules/webrtc-polyfill/index.js
./src/app/page.tsx
Note: I couldn't reproduce the issue with default nextjs starter app (everything worked fine)
t3-app is not npm install webrtc-polyfill
, default is latest, as per https://github.com/ThaUnknown/webrtc-polyfill/commit/8b9e26db4358c8c61ee1619b076af9611a670665, t3-app needs to update their dependencies
A very cool project https://github.com/dmotz/trystero now uses your library fork simple-peer
But when using with next.js it gives an obscure error "Module not found: Default condition should be last one" (https://github.com/dmotz/trystero/issues/76)
I see, that before version 1.1.1 the order of exports was wrong, but it was fixed here https://github.com/ThaUnknown/webrtc-polyfill/commit/8b9e26db4358c8c61ee1619b076af9611a670665. Trystero uses simle-peer ^10.0.7, which uses webrtc-polyfill ^1.1.6, but I still get the error 🤯
My capacity to understand this building nightmare is over, maybe you can magically fix something so it would work?
Thanks in advance