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

Missing modules in AJV #373

Closed
Kepro opened this issue Dec 9, 2016 · 20 comments
Closed

Missing modules in AJV #373

Kepro opened this issue Dec 9, 2016 · 20 comments

Comments

@Kepro
Copy link

Kepro commented Dec 9, 2016

after using AJV with webpack there is missing modules...

WARNING in .//ajv/lib/async.js
Module not found: Error: Cannot resolve module 'regenerator' in /home/kepro/Projects/node_modules/ajv/lib
@ ./
/ajv/lib/async.js 95:20-47

WARNING in .//ajv/lib/async.js
Module not found: Error: Cannot resolve module 'nodent' in /home/kepro/Projects/node_modules/ajv/lib
@ ./
/ajv/lib/async.js 116:26-48

WARNING in .//ajv/lib/compile/index.js
Module not found: Error: Cannot resolve module 'js-beautify' in /home/kepro/Projects/node_modules/ajv/lib
@ ./
/ajv/lib/compile/index.js 8:42-69

@epoberezkin
Copy link
Member

What is the version? Wasn't it solved by #363?

@mkhazov
Copy link

mkhazov commented Dec 16, 2016

4.10.0:

WARNING in ./~/ajv/lib/compile/index.js
13:21 Critical dependency: the request of a dependency is an expression

WARNING in ./~/ajv/lib/async.js
96:20 Critical dependency: the request of a dependency is an expression

WARNING in ./~/ajv/lib/async.js
119:15 Critical dependency: the request of a dependency is an expression

5.0.0-beta.1:

WARNING in ./~/ajv/lib/compile/index.js
Module not found: Error: Can't resolve 'js-beautify' in 'node_modules/ajv/lib/compile'
 @ ./~/ajv/lib/compile/index.js 13:21-48
 @ ./~/ajv/lib/ajv.js

WARNING in ./~/ajv/lib/async.js
Module not found: Error: Can't resolve 'regenerator' in 'node_modules/ajv/lib'
 @ ./~/ajv/lib/async.js 95:20-47
 @ ./~/ajv/lib/ajv.js

WARNING in ./~/ajv/lib/async.js
Module not found: Error: Can't resolve 'nodent' in 'node_modules/ajv/lib'
 @ ./~/ajv/lib/async.js 116:26-48
 @ ./~/ajv/lib/ajv.js

@epoberezkin
Copy link
Member

Webpack doesn't seem to have a way to manage optional dependencies. In any case, these messages are warnings, not errors, they seem to be manageable. See #117 (comment) for example.

@mkhazov
Copy link

mkhazov commented Dec 16, 2016

Thanks, it helped

new webpack.IgnorePlugin(/regenerator|nodent|js-beautify/, /ajv/)

@mkhazov
Copy link

mkhazov commented Dec 21, 2016

Actually I still see these warnings at the end of npm install or yarn. Is there a way to get rid of this?

@epoberezkin
Copy link
Member

It will be resolved by #382 and #383

@Kepro
Copy link
Author

Kepro commented Dec 26, 2016

thanks ;)

@epoberezkin
Copy link
Member

Resolved in 5.0.1-beta.0
To use: npm install ajv@^5.0.1-beta

@idangozlan
Copy link
Contributor

Neither v5-beta / Webpack ignore is solving this issue. @epoberezkin can't you fix the module to work as webpack expected with the sources instead of the dist file?

@epoberezkin
Copy link
Member

epoberezkin commented Jan 22, 2017

Is it "webpack": "dist/ajv.bundle.js" in package.json makes it work with compiled file? If so, it just has to be removed then.

@idangozlan
Copy link
Contributor

[0] WARNING in ./~/ajv/dist/ajv.bundle.js
[0] Critical dependencies:
[0] 1:476-483 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
[0]  @ ./~/ajv/dist/ajv.bundle.js 1:476-483

@epoberezkin
Copy link
Member

Does removing the line above solve the issue?

@idangozlan
Copy link
Contributor

idangozlan commented Jan 23, 2017 via email

@epoberezkin
Copy link
Member

@idangozlan I think you are using 4.x.x rather than beta version (5.0.1-beta). These optional dependencies are only removed in beta version, it won't be changed in 4.x.x.

@epoberezkin
Copy link
Member

epoberezkin commented Jan 23, 2017

Why webpack is trying to parse .jst files I have no idea - they are not required

@ricardolpd
Copy link

hi guys,
I am having the same issue with webpack, it seems to be trying to parse jst files, as webpack attempts to parse all files in the require.
Is there any way around this?

@epoberezkin
Copy link
Member

It's not the same problem really, it's webpack configuration issue - how to make it to ignore everything but js (or just ignore jst)

@ricardolpd
Copy link

Webpack cant also ignore these files as they will be needed, probably loading them into
I know its not really ajv fault for having this config issue, its just another one webpack issues however i hoped that @idangozlan maybe found a way around this, as i really haven't got time to do a jst loader for webpack, and i wanted to keep using ajv, thats all. As it stands i cant find a loader that will automatically load jst files in webpack, and that stops me from using ajv.

@epoberezkin
Copy link
Member

They are not used at run-time so they need to be ignored in webpack.

@joaoreynolds
Copy link

Upgraded ajv to v5 and the errors went away. Thanks!

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

No branches or pull requests

6 participants