Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Federation Runtime can't use SDK function while running at Nextjs #2831

Closed
5 tasks done
gokalpfirat opened this issue Aug 6, 2024 · 3 comments
Closed
5 tasks done

Comments

@gokalpfirat
Copy link

gokalpfirat commented Aug 6, 2024

Describe the bug

Code from remote/index.ts can't use isBrowserEnv function after 8.3.14 version after runtime core is refactored to runtime/index.ts.

Code is crashing at line

if (isBrowserEnv() && !remote.entry.startsWith('http')) {

Possible fix: isBrowserEnv function can be used from util folder https://github.com/module-federation/core/blob/main/packages/runtime/src/utils/env.ts without having to be imported from sdk

image
image
image

Reproduction

https://github.com/gokalpfirat/nextjs-mf-example-v2

npm run build && npm run start

Used Package Manager

npm

System Info

System: OS: Windows 10 10.0.19044 
CPU: (6) x64 Intel(R) Xeon(R) Platinum 8358 CPU @ 2.60GHz 
Memory: 3.19 GB / 24.00 GB  
Binaries: Node: 20.15.1 - ~\nvm\v20.15.1\node.EXE 
npm: 9.4.0 - ~\nvm\v20.15.1\npm.CMD
Browsers: Internet Explorer: 11.0.19041.3636

Validations

@ScriptedAlchemy
Copy link
Member

Provide a repo

@ScriptedAlchemy ScriptedAlchemy closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2024
@gokalpfirat
Copy link
Author

@ScriptedAlchemy added repo with reproduction case. It seems like when I try to add web worker it crashes with this case. You need to npm trun build and start to see https://github.com/gokalpfirat/nextjs-mf-example-v2
image

image

@gokalpfirat
Copy link
Author

Created new issue #2839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants