-
Notifications
You must be signed in to change notification settings - Fork 93
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
Unexpected token export #126
Comments
hmmm what is export going to even do? we would need to implement some sort of shim to implement it on behalf of v8. |
I was imagining something like this
I'm trying to get my standalone js string processing library to be callable from within the server using miniracer in rails, and also to go through webpacker to be callable from js on the client. Webpacker seems to insist I use import/export to communicate among files. Miniracer seems to dislike import/export. I need them to both run from the same source tree, but I can't figure out how to make them speak the same dialect of js. |
I think if it would just do nothing, that would be better than an exception. This makes it easy to eval files written in ESM syntax. Is there any way to prevent |
I think that would be a bad idea. Besides the fact that I don't know the first thing how to extend V8 with keywords/syntax, I think silently ignoring misuse is not good. There are plenty of tools available, to compile ESM-based scripts into other forms like CommonJS. For example we're using esbuild but webpack should also do the job. CommonJS can be easily implemented with a wrapper in mini_racer directly (you only need to wire up a Even better and more straight forward, is to bundle the scripts to be evaluated so you don't need any CommonJS, ESM etc at all. |
I'm confused. Do I have to set flags or something to have mini_racer understand
export
?The text was updated successfully, but these errors were encountered: