Skip to content

Repeated warnings when running in a Next.js app #200

Open
@claquesous

Description

@claquesous

I'm getting constant warnings when using IcecastMetadataPlayer in a Next.js app.

I'm including it in a component called player.tsx this way: import IcecastMetadataPlayer from 'icecast-metadata-player'

When I tried a production build, I get this output during the build step which match the warnings when running in dev mode.

   Creating an optimized production build ...
 ⚠ Compiled with warnings

./node_modules/@eshaz/web-worker/cjs/node.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./node_modules/@eshaz/web-worker/cjs/node.js
./node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderWorker.js
./node_modules/@wasm-audio-decoders/common/index.js
./node_modules/@wasm-audio-decoders/flac/index.js
./node_modules/icecast-metadata-player/src/players/WebAudioPlayer.js
./node_modules/icecast-metadata-player/src/PlayerFactory.js
./node_modules/icecast-metadata-player/src/IcecastMetadataPlayer.js
./app/_components/player.tsx

./node_modules/synaudio/node_modules/@eshaz/web-worker/cjs/node.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./node_modules/synaudio/node_modules/@eshaz/web-worker/cjs/node.js
./node_modules/synaudio/src/SynAudio.js
./node_modules/synaudio/index.js
./node_modules/icecast-metadata-player/src/FrameQueue.js
./node_modules/icecast-metadata-player/src/players/Player.js
./node_modules/icecast-metadata-player/src/PlayerFactory.js
./node_modules/icecast-metadata-player/src/IcecastMetadataPlayer.js
./app/_components/player.tsx

 ✓ Compiled successfully

Originally, the Generating static pages step failed too, but I used this workaround to get the overall build to succeed:
https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#with-no-ssr

I don't really know much about Web Assembly, but I'm guessing the dynamic workaround could be because it just won't work server side. So be it. I'm wondering if the warning is legitimate though.

Thanks for your consideration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions