Using export * from '...' in a page shouldn't be allowed by Next.js.
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'
An build error should occur.
@Timer I came up with naive implementation regexing the page, but I'm quite sure there is a more "appropriate/elegant" way to achieve that. Maybe I should look into webpack?
@Timer I came up with naive implementation regexing the page, but I'm quite sure there is a more "appropriate/elegant" way to achieve that. Maybe I should look into webpack?
It can be achieved using a babel plugin
@Timer I came up with naive implementation regexing the page, but I'm quite sure there is a more "appropriate/elegant" way to achieve that. Maybe I should look into webpack?
It can be achieved using a babel plugin
I couldn't find any babel plugin for this issue. Does configuring .eslintrc will fix this issue?
It'll need to be a custom babel plugin!
@Timer or @timneutkens
In addition to export * from '...' in pages,
Does export {default} from '...' in pages too should be allowed or not ?
I got a custom babel plugin which works for export * from '...', work in progress :)
export {default} from '...'
is a fine behavior!
Hello, I would like to make my first contribution in the project, can I take this issue?
There's an open PR for this one already @AndresContreras96: #14325