Skip to content

Incompatibility with babel 7 #12

@rubeniskov

Description

@rubeniskov

In babel 7 the property state.file.log is undefined and raises the following error

{ TypeError: .../src/WidgetWorkspace3DViewer.js: Cannot read property 'filename' of undefined
    at PluginPass.CallExpression (.../node_modules/babel-plugin-glslify/glslify-babel.js:183:39)
    at newFn (.../node_modules/@babel/traverse/lib/visitors.js:175:21)
    at NodePath._call (.../node_modules/@babel/traverse/lib/path/context.js:55:20)
    at NodePath.call (.../node_modules/@babel/traverse/lib/path/context.js:42:17)
    at NodePath.visit (.../node_modules/@babel/traverse/lib/path/context.js:92:31)
    at TraversalContext.visitQueue (.../node_modules/@babel/traverse/lib/context.js:116:16)
    at TraversalContext.visitMultiple (.../node_modules/@babel/traverse/lib/context.js:83:17)
    at TraversalContext.visit (.../node_modules/@babel/traverse/lib/context.js:142:19)
    at Function.traverse.node (.../node_modules/@babel/traverse/lib/index.js:82:17)
    at NodePath.visit (.../node_modules/@babel/traverse/lib/path/context.js:99:18) code: 'BABEL_TRANSFORM_ERROR' }

from this lines:

var filename = state.file.log.filename

var filename = state.file.log.filename

some references:
babel/babel#7715
https://stackoverflow.com/questions/35857271/get-current-filename-in-babel-plugin

I will post a PR to fixed

Kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions