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

Latest release break webpack because of class field declarations #2265

Closed
alan-agius4 opened this issue Jan 5, 2020 · 6 comments
Closed
Assignees
Labels
support Questions, discussions, and general support

Comments

@alan-agius4
Copy link

alan-agius4 commented Jan 5, 2020

Support plan

  • which support plan is this issue covered by? (e.g. Community, Core, Plus, or Enterprise): n/a
  • is this issue currently blocking your project? (yes/no): yes, because we will be unable to update Angular universal to use the latest @hapi/inerit build: update @hapi/inert to version 6.0.3 angular/universal#1434
  • is this issue affecting a production system? (yes/no):

Context

What are you trying to achieve or the steps to reproduce?

Try to bundle with @hapijs/joi.

What was the result you got?

ERROR in ./node_modules/@hapi/inert/node_modules/@hapi/joi/lib/errors.js 246:10
[0] Module parse failed: Unexpected token (246:10)
[0] You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
[0] | exports.ValidationError = class extends Error {
[0] | 
[0] >     isJoi = true;
[0] |     name = 'ValidationError';
[0] | 
[0] 
[0] ERROR in ./node_modules/@hapi/inert/node_modules/@hapi/joi/lib/base.js 27:16
[0] Module parse failed: Unexpected token (27:16)
[0] You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
[0] | internals.Base = class {
[0] | 
[0] >     isImmutable = true;                             // Prevents Hoek from deep cloning schema objects
[0] | 
[0] |     constructor(type) {

What result did you expect?

That it works, maybe until webpack supports ES6 class fields declarations, revert the change?

@alan-agius4 alan-agius4 added the support Questions, discussions, and general support label Jan 5, 2020
@Marsup
Copy link
Collaborator

Marsup commented Jan 5, 2020

Our own joi build works though, could it be your config that's wrong?

@alan-agius4
Copy link
Author

Most likely it works in your case because you are down levelling using babel-loader. In my case I am not interesting in down levelling.

@Edgar-P-yan
Copy link

Edgar-P-yan commented Jan 5, 2020

This version of joi (17.0.0) also does not work with node < v12 (in my case node v10.16.3), because class field declarations are available only in node > v12.x

@Marsup
Copy link
Collaborator

Marsup commented Jan 5, 2020

This version of joi (17.0.0) also does not work with node < v12 (in my case node v10.16.3), because class field declarations are available only in node > v12.x

Well yes, it's explicitly written in the breaking changes, don't bump without reading what breaks.

@Marsup
Copy link
Collaborator

Marsup commented Jan 5, 2020

@alan-agius4 is it a problem to stick to 16 anyway? No one is forcing you to upgrade if you're not ready.

@hueniverse
Copy link
Contributor

It is clearly documents and released as a major. This is how JS works - you use the versions of things that fit your setup.

@hueniverse hueniverse self-assigned this Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

4 participants