Skip to content

Bug since v8 with @babel/runtime and cjs module #599

@xD3CODER

Description

@xD3CODER

Hello,

I planned to upgrade my project to react-spring 8.x but I have some difficulties to handle it.
I have followed migration guide to import Transition from cjs file but I have an error with @babel/runtime

to be executed: "npx babel-node ./index.js"
C:\Users\xD3CODER\Desktop\Personal\node_modules\@babel\runtime\helpers\esm\objectWithoutPropertiesLoose.js:1
(function (exports, require, module, __filename, __dirname) { export default function _objectWithoutPropertiesLoose(source, excluded) {
                                                              ^^^^^^

SyntaxError: Unexpected token export
    at new Script (vm.js:83:7)
    at createScript (vm.js:267:10)
    at Object.runInThisContext (vm.js:319:10)
    at Module._compile (internal/modules/cjs/loader.js:685:28)
    at Module._compile (C:\Users\xD3CODER\Desktop\Personal\node_modules\pirates\lib\index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Object.newLoader [as .js] (C:\Users\xD3CODER\Desktop\Personal\node_modules\pirates\lib\index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)

I tried to require the file from @babel/runtime from my entrypoint and i have no errors
require('@babel/runtime/helpers/objectWithoutPropertiesLoose')
I use @babel/preset-env for transpiling and @babel/register

Thanks for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions