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

Webpack upgrade breaks TypeScript interface exports #6668

Closed
rodogir opened this issue Mar 15, 2019 · 2 comments
Closed

Webpack upgrade breaks TypeScript interface exports #6668

rodogir opened this issue Mar 15, 2019 · 2 comments
Labels
good first issue Easy to fix issues, good for newcomers

Comments

@rodogir
Copy link

rodogir commented Mar 15, 2019

Bug report

Describe the bug

TypeScript interfaces and type aliases that are exported in an object break the dev and prod build. The build will fail with a Module parse failed: Export 'XYZ' is not defined message.

To clarify what I mean with object export, here is a small example:

interface MyInterface {};
export { MyInterface };

This used to work fine in Next 7. The bug was probably introduced in https://github.com/zeit/next.js/releases/tag/v8.0.0-canary.12. Version v8.0.0-canary.11 does not have this problem.

To Reproduce

  1. Setup https://github.com/zeit/next.js/tree/canary/examples/with-typescript
  2. Make sure it runs correctly
  3. Open any component (e.g. components/List.tsx)
  4. Add export { Props }; to the last line
  5. The build breaks

System information

  • OS: Windows 10
  • Version of Next.js: 8.0.3
@timneutkens timneutkens added help wanted good first issue Easy to fix issues, good for newcomers labels Mar 15, 2019
@toshi1127
Copy link
Contributor

@timneutkens
I could confirm that it would work by canceling #6114.
How should I fix it ...?

@rodogir
Copy link
Author

rodogir commented Mar 28, 2019

I did some further research after this problem also started appearing in fresh Next.js 7 and non-next builds. It seems that this is bug in babel:
See: babel/babel#9766 and babel/babel#9763.

@rodogir rodogir closed this as completed Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants