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

updating from 1.7.4 to 1.7.7 breaking changes #122

Closed
DanielZlotin opened this issue May 8, 2016 · 4 comments
Closed

updating from 1.7.4 to 1.7.7 breaking changes #122

DanielZlotin opened this issue May 8, 2016 · 4 comments

Comments

@DanielZlotin
Copy link

1.7.4 everything worked.
broken test suite as a result from the update: (1.7.5 and 1.7.6 same issue)

SyntaxError: Unexpected token import
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Module._extensions..js (module.js:422:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/danielzl/dev/wix-one-app/node_modules/babel-register/lib/node.js:138:7)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/danielzl/dev/wix-one-app/node_modules/proxyquire/lib/proxyquire.js:255:43)
    at Object.require.extensions.(anonymous function) (/Users/danielzl/dev/wix-one-app/node_modules/proxyquire/lib/proxyquire.js:255:43)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Proxyquire._require (/Users/danielzl/dev/wix-one-app/node_modules/proxyquire/lib/proxyquire.js:166:19)
    at require (internal/module.js:16:19)
@bendrucker
Copy link
Collaborator

Without your source code we can't look

@DanielZlotin
Copy link
Author

DanielZlotin commented May 8, 2016

@bendrucker What source do you need?
this is my usage:

const rootPath = require('app-root-path');
const proxyquireLib = require('proxyquire');
...
test = {
proxyquire: (path, imports) => {
    return proxyquireLib.noCallThru().noPreserveCache()(rootPath.resolve(path), imports);
  }

...


const uut = test.proxyquire('src/reducers/session/actions', {
      'my-module': {}, ...
});
...

inside src/reducers/session/actions the first line is import _ from 'lodash';
before the update to 1.7.5 everything worked.

now it seems babel is not working with modules imported with proxyquire.

@bendrucker
Copy link
Collaborator

now it seems babel is not working with modules imported with proxyquire

As of 1.7.5 the noPreserveCache behavior deletes additional modules from the cache to resolve a bug: #102. We don't formally support transpilation right now even if it worked before. In order to get it working again and supported, we'll need a failing test and some investigation. Since I don't use Babel this is a relatively low priority for me. If you want to work on a PR I can review it, otherwise I'll come back to this and address it sometime.

@bendrucker
Copy link
Collaborator

For right now, just pin your version to 1.7.4

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

2 participants