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

The project doesn't running with deps in "DEPENDECIES" #24

Closed
pedrocandidozup opened this issue Apr 3, 2024 · 6 comments
Closed

The project doesn't running with deps in "DEPENDECIES" #24

pedrocandidozup opened this issue Apr 3, 2024 · 6 comments

Comments

@pedrocandidozup
Copy link

I look for the projects @gioboa is providing in the github, but all the projects you put all dependecies in "devDependecies" for the project work, e.g:

https://github.com/gioboa/react-microfrontends-spotify/blob/main/host/package.json

Is the same for me in the projects, when I putting some deps in "dependencies" is shown the error
image

and If I stay "react" in "dependecies" the error is shown
The entry point "react" cannot be marked as externa

@pedrocandidozup
Copy link
Author

`{
"name": "host",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --port 4173",
"build": "tsc && vite build",
"preview": "npm run build && vite preview --port 4173"
},
"dependencies": {
"rxjs": "^7.8.1"

},
"devDependencies": {
	"@module-federation/vite": "^0.2.8",
	"@softarc/native-federation-esbuild": "^2.0.4",
	"@softarc/native-federation": "^2.0.4",
	"@types/react-dom": "^18.2.14",
	"@types/react": "^18.2.33",
	"@vitejs/plugin-react": "^4.1.0",
	"autoprefixer": "^10.4.16",
	"esbuild": "^0.19.5",
	"postcss-load-config": "^4.0.1",
	"postcss": "^8.4.31",
	"react-dom": "^18.2.0",
	"react": "^18.2.0",
	"tailwindcss": "^3.3.5",
	"typescript": "^5.2.2",
	"vite": "^4.5.0"
}

}`

In your repository @gioboa, when I put "react" in dependecies in the same error is shown
The entry point "react" cannot be marked as external and when I put the whatever other depeds in "dependencies" is show the same error

@pedrocandidozup
Copy link
Author

Is the same for the Example Module Federation the project doesn't work because "react" is stay in dependencies
when I put in the devDependencies the error is gone, but in my project here for the project is running I need to put all my deps in devDependencies

image

@pedrocandidozup pedrocandidozup changed the title The project doesn't running with depeds in "DEPENDECIES" The project doesn't running with deps in "DEPENDECIES" Apr 15, 2024
@sedx
Copy link

sedx commented Apr 23, 2024

Hi! For solving The entry point "react" cannot be marked as external see my answer in this issue #16 (comment)

For suppress pre-transform error, try to set server.preTransformRequests to false in vite config. Looks like we don't need deps pre-transformation because it's work of adapter.

@pedrocandidozup
Copy link
Author

@sedx yes, after that, I tried to removed "react" at vite.config, but I think it not the best solutions..

I will try use "server.preTransformRequests"

@gioboa
Copy link
Collaborator

gioboa commented May 26, 2024

We are working on a new version that will definitely solves this. @ScriptedAlchemy did a big step forward, he did the official esbuild adapter and the runtime loaders too.

@gioboa
Copy link
Collaborator

gioboa commented Aug 16, 2024

We are working on a new version of this package in this PR
I'm closing this issue, if you want, you can try the new version and give us feedback. Thanks.

@gioboa gioboa closed this as completed Aug 16, 2024
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

3 participants