Re-exporting all exports from a page should be disallowed
See original GitHub issueBug report
Describe the bug
Using export * from '...'
in a page shouldn’t be allowed by Next.js.
To Reproduce
Create two pages:
// pages/one.js
import fs from 'fs';
export default function A() {
return <main />
}
export function getStaticProps() {
fs;
return { props: { } };
}
// pages/two.js
export * from './one'
This causes the following error:
Module not found: Can't resolve 'fs' in './pages/two.js'
Expected behavior
An build error should occur.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
Top Results From Across the Web
export-all-in-page - Next.js
Re-exporting all exports from a page is disallowed. Why This Error Occurred. The following export can potentially break Next.js' compilation of pages:
Read more >Disallow Export * from "" - Stack Overflow
So I have a React app and I want to disable re-exporting all the exports. Here is an example which should give me...
Read more >Re-export values from another file in JavaScript | bobbyhadz
To re-export values from another file in JavaScript, make sure to export the name exports as `export {myFunction, myConstant} from '.
Read more >Deemed Exports FAQs - What is a "deemed re-export"?
BIS will apply the licensing policy set forth in §746.5, "Russian Industry Sector Sanctions," to the review of all license applications for controlled...
Read more >no-restricted-exports - ESLint - Pluggable JavaScript Linter
Only the names you specify in the configuration will be disallowed. ... This rule doesn't inspect the content of source modules in re-export...
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
is a fine behavior!
It can be achieved using a babel plugin