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.

pass.get(...) is not a function in @babel/plugin-transform-react-jsx

See original GitHub issue

Bug Report

Hi there 👋 So from this morning around 08:30GMT we are seeing the following error when we try to compile our code with Rollup. Here is the stack trace that we are seeing…

image

It looks to be able the same time you published an update to @babel/plugin-transform-react-jsx recently.

Here is the setup of Babel packages we are using.

"@babel/cli": "7.2.0",
"@babel/core": "7.2.0",
"@babel/eslint-parser": "^7.11.3",
"@babel/plugin-proposal-class-properties": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.6.0",
"@babel/plugin-transform-spread": "7.2.0",
"@babel/preset-env": "7.2.0",
"@babel/preset-react": "7.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-loader": "8.0.4",
"babel-plugin-add-react-displayname": "0.0.5",
"babel-plugin-file-loader": "1.1.1",
"babel-plugin-inline-import-data-uri": "1.0.1",
"babel-plugin-inline-react-svg": "1.1.0",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-transform-replace-object-assign": "^2.0.0",

Is there anything you suggest we should do instead?

Environment


  • Node/npm version: 10.15.3
  • OS: Windows
  • Monorepo: No
  • How you are using Babel: Rollup

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jacktomlinsoncommented, Dec 10, 2020

Sure…

<?xml version="1.0" encoding="UTF-8"?>
<svg width="18px" height="22px" viewBox="0 0 18 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>CBBB799B-32FC-47EB-9B9C-18F19ABB1780</title>
    <defs>
        <path d="M14.3328269,1.18151571 L20.7479059,7.59659466 C20.9130288,7.76171763 21.0423341,7.94902103 21.1356664,8.14889997 C21.248758,8.37028715 21.3206325,8.61723524 21.340856,8.87946331 L21.3467206,9.03223405 C21.3467206,9.67590655 21.0357121,10.2464554 20.5524744,10.5999068 L14.3328269,16.8184843 C13.5769822,17.574329 12.3470125,17.5744051 11.5884372,16.8158298 C10.8245732,16.0519658 10.8286734,14.8285493 11.5857827,14.07144 L11.5857827,14.07144 L14.6812154,10.9746291 L2.5764561,10.9746877 C1.49992016,10.9746877 0.627215354,10.1125008 0.627215354,9.03223405 C0.627215354,7.95944654 1.49112776,7.08978043 2.5764561,7.08978043 L14.7472154,7.08962912 L11.5857827,3.92855995 C10.8286734,3.17145068 10.8245732,1.9480342 11.5884372,1.18417023 C12.3470125,0.42559491 13.5769822,0.42567101 14.3328269,1.18151571 Z" id="path-1"></path>
    </defs>
    <g id="Mobile" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="320-SP---Car---Flow-1.2.1" transform="translate(-207.000000, -495.000000)">
            <g id="Modal-Copy" transform="translate(12.000000, 24.000000)">
                <g id="Car-Button-/-Medium-/-Secondary" transform="translate(64.000000, 460.000000)">
                    <g id="Group-6" transform="translate(16.000000, 10.000000)">
                        <g id="Icon/Pencil" transform="translate(124.000000, 12.000000) rotate(90.000000) translate(-124.000000, -12.000000) translate(113.000000, 3.000000)">
                            <mask id="mask-2" fill="white">
                                <use xlink:href="#path-1"></use>
                            </mask>
                            <use id="Combined-Shape-Copy" fill="#FFFFFF" xlink:href="#path-1"></use>
                            <g id="↳-Icon-fill" mask="url(#mask-2)" fill="#108A00">
                                <g transform="translate(-1.000000, -3.000000)" id="Rectangle">
                                    <rect x="0" y="0" width="24" height="24"></rect>
                                </g>
                            </g>
                        </g>
                    </g>
                </g>
            </g>
        </g>
    </g>
</svg>

And babel-plugin-inline-react-svg is at “1.1.0” @nicolo-ribaudo

1reaction
jacktomlinsoncommented, Dec 10, 2020

Hey @nicolo-ribaudo ! Yeah sure…

We believe it was coming from this file.

import arrow from './arrow.svg';

export {
    arrow,
};

With this babel config…

module.exports = (api) => {
    api.cache(true);
    const presets = [
        ['@babel/preset-env', {
            targets: {
                ie: 9
            }
        }],
        '@babel/preset-react'
    ];
    const plugins = [
        '@babel/plugin-transform-spread',
        '@babel/plugin-proposal-class-properties',
        '@babel/plugin-transform-runtime',
        'add-react-displayname',
        'inline-react-svg',
        ['inline-import-data-uri', {
            extensions: [
                '.html',
                '.svg',
                '.png',
                '.jpg'
            ]
        }]
    ];
    return {
        presets,
        plugins
    };
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

babel/plugin-transform-react-jsx
Automatic runtime is a feature added in v7.9.0 . With this runtime enabled, the functions that JSX compiles to will be imported automatically....
Read more >
Babel.js: Uncaught TypeError: _interopRequireDefault is not a ...
I was trying to compile server-side (think Rails or Django) generated JavaScript that may have react or such, then pass the JS to...
Read more >
pass.get(...) is not a function; plugin-transform-react-jsx 7.9 ...
it seems that the variable that was refactored in b1e73d6f961065c56427ffa89c130beea8321d3b (file -> state.file) in helper-builder-react-jsx/lib/ ...
Read more >
How to use the @babel/plugin-transform-react-jsx.default ...
To help you get started, we've selected a few @babel/plugin-transform-react-jsx examples, based on popular ways it is used in public projects. ; function...
Read more >
@babel/plugin-transform-react-jsx-source - Package Manager
@babel/plugin-transform-react-jsx-source. owner babel18.2mMIT7.19.6 vulns 0 vulnerabilities. Add a __source prop to all JSX Elements. babel-plugin ...
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