fkling / fkling/astexplorer

"require is not defined" for babel helpers

Open
#648 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
6.5k
Forks
772
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I'd like to prototype a babel plugin using this tool

**To Reproduce**
Simply paste the example from [this page](https://babeljs.io/docs/en/babel-helper-module-imports) into AST Explorer, with `@babel/parser` and `babelv7`

**Expected behavior**
The code should compile, but it just says `require is not defined`

**Link**
https://astexplorer.net/#/gist/d1f885f50ed5768a6424565593218177/039b053eb350e562394d83650894173cd7d2eb6f

**Browser (please complete the following information):**
- OS: macOS
- Browser: Firefox
- Version: 100.0.2

**astexplorer settings:**
- Selected parser: `@babel/parser`
- Selected transformer (if applicable): `babelv7`
- Contents of the local storage key `explorerSettingsV1` N/A, the same thing happens in incognito window

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the linked AST Explorer example with @babel/parser and babelv7, then trace how the babelv7 transformer loads Babel helpers in the browser. Check the browser error and the transformer or runtime entry points involved; done means the example compiles without “require is not defined”.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript
Domain
tooling, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.