Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with babel 7 #12

Open
rubeniskov opened this issue Oct 30, 2020 · 5 comments
Open

Incompatibility with babel 7 #12

rubeniskov opened this issue Oct 30, 2020 · 5 comments

Comments

@rubeniskov
Copy link

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

@rubeniskov
Copy link
Author

any update?

@marcofugaro
Copy link

Is this plugin dead?

@rubeniskov
Copy link
Author

Is this plugin dead?

it seems yes

@marcofugaro
Copy link

marcofugaro commented Jan 2, 2021

Switched to babel-plugin-glsl.

It has this feature which is actually very useful.

@glafarge
Copy link

@rubeniskov Thank's for the fix.
Before the PR is accepted, you can patch-package with those changes. Solved the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants