[Typescript] Next.js Error fetching types - not exposed by remote app
See original GitHub issueMigrating this issue over now that the typescript package is located in this repo: https://github.com/module-federation/typescript/issues/25
Essentially, @mf-typescript
is being written to .next
as that is the output path for Next.js apps, but .next
is not being publicly served so any app which wants to download the types from /@mf-typescript/__types_index.json
will get a 404.
My suggestion is to output the types to public
instead but @pavandv suggests he knows why and has a fix in mind?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Ignoring TypeScript Errors - next.config.js
Next. js fails your production build ( next build ) when TypeScript errors are present in your project. If you'd like Next.
Read more >Internal API fetch with getServerSideProps? (Next.js)
The reason I'm not doing the required calculations for home.js in the API route itself is that I need more generic data from...
Read more >Fetching and hydrating a Next.JS app using ... - Medium
When your app needs to process data from an external source (as in a fetch for a remote JSON file) you have two...
Read more >Creating a Project with Nest.js + Next.js - DEV Community
Open localhost:3000 in your browser and you will see a 404. Which is unexpected since we have both a controller and a NEXT.js...
Read more >How typesafe can a remote be with Typescript? #20 - GitHub
As the remote var does not have type, I don't see a way to ... Are your exposes objects exposed as standard javascript/typescript...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hongkiulam @pavandv I am working on a solution that will allow you to specify the location of the
__types_index.json
for each remote as you will have situations like described above when mixing various Next and non-Next applications.For the time being, you can get around this issue by adding the following to your webpack configuration:
After this got merged in https://github.com/module-federation/nextjs-mf/pull/302, types are now looked up at
/_next/static/chunks/@mf-typescript/__types_index.json
.So the new workaround should be