question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Automatic Babel Transformation problematic

See original GitHub issue

Hey Orta!

Thanks for all your hard work on Danger. Fantastic tool šŸ˜ƒ.

Iā€™m running into an issue with the automatic Babel transformation that I wanted to discuss with you and any other collaborators before submitting a Pull Request.

My project is a pretty standard webpack/babel compiled front-end application. Iā€™m running Danger on node 8.x, so I really do not need Babel transformation of my dangerfile.

Right now, because of my babel-preset-env config for builds targeting web browsers, template literals in my dangerfile are being compiled to ES5. This would be fine, except my .babelrc is setup to use transform-runtime. This is problematic because Babel 6 has a bug where transform-runtime injects import declarations rather than require calls. After this happens, Danger fails on calls to nodeā€™s module._compile.

I can work around this issue by moving everything in my Babel config to use the env feature temporarily, and have no ā€œdefaultā€ babel config. However, Iā€™m concerned that the automatic Babel transformation in Danger without an opt-out is a bit heavy-handed.

Would you be willing to accept a PR that disables Babel/TypeScript transformation?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

15reactions
bj-mcduckcommented, Feb 7, 2020

Just to chime in, the default example of setting up an action with the following gets the same Error: Cannot find module '@babel/plugin-transform-flow-strip-types' from '/github/workspace' error. Sounds like itā€™s the same issue?

name: Danger checks

on: pull_request

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Danger
      uses: danger/danger-js@9.2.10
      env: 
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3reactions
pietmichalcommented, Jul 28, 2020

@brandonjmckay Setting DANGER_DISABLE_TRANSPILATION="true" env var fixed it for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel/plugin-transform-runtime
The transform-runtime transformer plugin does three things: Automatically requires @babel/runtime/regenerator when you use generators/async functions (Ā ...
Read more >
Why does Babel transform object parameter lists in React ...
{ presets: [ [ '@babel/preset-react', { runtime: 'automatic', }, ], '@babel/preset-flow', [ '@babel/preset-env', { useBuiltIns: 'usage', corejs:Ā ...
Read more >
babel-plugin-transform-react-binding - npm package - Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fixĀ ...
Read more >
Features & optimizations - Packemon
The presets and plugins used are automatically determined on a package-by-package ... While Babel handles the parsing and transformation of source files,Ā ...
Read more >
Get started with Babel 7 | Creative Bloq
Babel works around this problem via automatic transpilation. ... These dependencies transformed the release process of the predecessor intoĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found