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

Critical dependency: the request of a dependency is an expression? #354

Closed
3 tasks done
chris-dura opened this issue Mar 13, 2018 · 9 comments
Closed
3 tasks done

Comments

@chris-dura
Copy link

chris-dura commented Mar 13, 2018

Description

Just run the tests that were working just fine on previous versions.

Issue

Upgrading from v3.2.6 to v3.5.2 now pumps out a warning with Webpack/Karma/Mocha...

WARNING in ./node_modules/testdouble/lib/replace/module.js
29:15-54 Critical dependency: the request of a dependency is an expression
 @ ./node_modules/testdouble/lib/replace/module.js
 @ ./node_modules/testdouble/lib/replace/index.js
 @ ./node_modules/testdouble/lib/index.js
 @ ./test/unit/my-tests/my.test.js
 @ ./test/unit \.test\.js$
 @ ./test/unit/index.js

WARNING in ./node_modules/testdouble/lib/replace/module.js
33:15-35:17 Critical dependency: the request of a dependency is an expression
 @ ./node_modules/testdouble/lib/replace/module.js
 @ ./node_modules/testdouble/lib/replace/index.js
 @ ./node_modules/testdouble/lib/index.js
 @ ./test/unit/my-tests/my.test.js
 @ ./test/unit \.test\.js$
 @ ./test/unit/index.js

Environment

  • node -v output: v8.9.4
  • npm -v (or yarn --version) output: 5.7.1
  • npm ls testdouble (or yarn list testdouble) version: testdouble@3.5.2

Code-fenced Examples

import td from 'testdouble';

describe('Some Test', function() {
  it('tests testdouble', () => {
    const foo = td.func('bar');
    assert.isOk(true);
  });
});
@tyler36
Copy link

tyler36 commented Mar 22, 2018

Same for me after updating

@searls
Copy link
Member

searls commented Mar 22, 2018

Could you please provide a minimal repo that reproduces this issue? That'd help me figure out the exact cause

@tyler36
Copy link

tyler36 commented Mar 28, 2018

Sorry for the late reply.

https://github.com/tyler36/testdouble-warning

OS: Win10
node -v: 9.4.0
yarn --version: 1.5.1
testdouble@3.6.0

@searls searls closed this as completed in fa2d283 Apr 27, 2018
@searls
Copy link
Member

searls commented Apr 27, 2018

I think I have this fixed by adding both src and lib for that file to the package.json's browser directive

@chris-dura
Copy link
Author

@searls Can you clarify, I don't quite understand what you're referencing?

@searls
Copy link
Member

searls commented Apr 27, 2018

This fixes it: https://github.com/testdouble/testdouble.js/blob/master/package.json#L56

I can't cut a release until we overcome various npm related issues locally though

@chris-dura
Copy link
Author

ah ok, thank you!

@tyler36
Copy link

tyler36 commented May 1, 2018

@searls, warning no longer appears in 3.8.0

Thank you for the update :)

sidohaakma added a commit to sidohaakma/molgenis that referenced this issue Aug 2, 2018
dennishendriksen pushed a commit to molgenis/molgenis that referenced this issue Aug 2, 2018
* updated security-manager eslint packages

* fix/warnings yarn install

* updated babel-eslint version to match form version

* updated vue version of questionnaire to range

* updated forms version and global yarn and node version

* downgraded vue and updated forms and test-utils

* updated testdouble see testdouble/testdouble.js#354
@ZarekParker
Copy link

@searls seeing this on 3.8.1

Warning in ./node_modules/testdouble/lib/replace/module/require-actual.js

  Critical dependency: the request of a dependency is an expression

Warning in ./node_modules/testdouble/lib/replace/module/require-actual.js

  Critical dependency: the request of a dependency is an expression

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

4 participants