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

SyntaxError: Unexpected token export #6

Open
samselikoff opened this issue Feb 21, 2019 · 1 comment
Open

SyntaxError: Unexpected token export #6

samselikoff opened this issue Feb 21, 2019 · 1 comment

Comments

@samselikoff
Copy link

Hey Casey!

I'm getting ready to drop Faker from Mirage, and I wrote up some upgrade notes. I reference this awesome library so folks can find it 👍

I wanted to try this out on our codebase and I'm getting this error:

(function (exports, require, module, __filename, __dirname) { export default function transformer (file, api) {
                                                              ^^^^^^

Any ideas on what's wrong?

Full stack trace
➜  ember-map-frontend git:(upgrade-mirage) jscodeshift -t https://raw.githubusercontent.com/caseywatts/ember-cli-mirage-faker-codemod/master/transform.js ./tests

Processing 67 files...
Spawning 7 workers...
Sending 10 files to free worker...
Sending 10 files to free worker...
Sending 10 files to free worker...
Sending 10 files to free worker...
Sending 10 files to free worker...
Sending 10 files to free worker...
Sending 7 files to free worker...
/private/var/folders/v5/5bs4trnx5v7bly3f0cg4_sc40000gn/T/jscodeshift119121-52723-r6x1hd.9wcx:1
(function (exports, require, module, __filename, __dirname) { export default function transformer (file, api) {
                                                              ^^^^^^

SyntaxError: Unexpected token export
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (/Users/samselikoff/.config/yarn/global/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
/private/var/folders/v5/5bs4trnx5v7bly3f0cg4_sc40000gn/T/jscodeshift119121-52723-r6x1hd.9wcx:1
(function (exports, require, module, __filename, __dirname) { export default function transformer (file, api) {
                                                              ^^^^^^

SyntaxError: Unexpected token export
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (/Users/samselikoff/.config/yarn/global/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
/private/var/folders/v5/5bs4trnx5v7bly3f0cg4_sc40000gn/T/jscodeshift119121-52723-r6x1hd.9wcx:1
(function (exports, require, module, __filename, __dirname) { export default function transformer (file, api) {
                                                              ^^^^^^

SyntaxError: Unexpected token export
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (/Users/samselikoff/.config/yarn/global/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
/private/var/folders/v5/5bs4trnx5v7bly3f0cg4_sc40000gn/T/jscodeshift119121-52723-r6x1hd.9wcx:1
(function (exports, require, module, __filename, __dirname) { export default function transformer (file, api) {
                                                              ^^^^^^

SyntaxError: Unexpected token export
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (/Users/samselikoff/.config/yarn/global/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
/private/var/folders/v5/5bs4trnx5v7bly3f0cg4_sc40000gn/T/jscodeshift119121-52723-r6x1hd.9wcx:1
(function (exports, require, module, __filename, __dirname) { export default function transformer (file, api) {
                                                              ^^^^^^

SyntaxError: Unexpected token export
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (/Users/samselikoff/.config/yarn/global/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
/private/var/folders/v5/5bs4trnx5v7bly3f0cg4_sc40000gn/T/jscodeshift119121-52723-r6x1hd.9wcx:1
(function (exports, require, module, __filename, __dirname) { export default function transformer (file, api) {
                                                              ^^^^^^

SyntaxError: Unexpected token export
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (/Users/samselikoff/.config/yarn/global/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
/private/var/folders/v5/5bs4trnx5v7bly3f0cg4_sc40000gn/T/jscodeshift119121-52723-r6x1hd.9wcx:1
(function (exports, require, module, __filename, __dirname) { export default function transformer (file, api) {
                                                              ^^^^^^

SyntaxError: Unexpected token export
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (/Users/samselikoff/.config/yarn/global/node_modules/pirates/lib/index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
All done.
@samselikoff
Copy link
Author

Figured out the problem, bug in jscodeshift. Waiting on PR here: facebook/jscodeshift#317

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

1 participant