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

Bug: swc does not import the _interopRequireDefault function when it is referenced #138

Closed
lily-mara opened this issue Feb 8, 2019 · 2 comments

Comments

@lily-mara
Copy link
Contributor

If you try compiling the following with swc:

import Foo from 'bar';

You get this:

'use strict';
var _bar = _interopRequireDefault(require('bar'));

The function _interopRequireDefault is referenced, though never defined, leading to ReferenceErrors.

There are other functions that have the same behavior:

  • _interopRequireWildcard

Expected: If swc inserts references to functions, it will define or import those functions.

Actual: swc references numerous functions that it does not define/import.

@kdy1 kdy1 closed this as completed in 654f55b Feb 9, 2019
@kdy1
Copy link
Member

kdy1 commented Feb 9, 2019

Thank you for the reporting an issue.
I fixed this with swc@1.0.1

@swc-bot
Copy link
Collaborator

swc-bot commented Oct 31, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants