jquense / yup

Dead simple Object schema validation
MIT License
22.77k stars 928 forks source link

Dependency not found: @babel/runtime/helpers/builtin/objectWithoutPropertiesLoose #260

Closed luke-dare closed 6 years ago

luke-dare commented 6 years ago

I'm seeing the following behaviour with v0.26.0.

If I revert to v0.25.1, all is well.


* @babel/runtime/helpers/builtin/objectWithoutPropertiesLoose in ./node_modules/yup/lib/Lazy.js, ./node_modules/yup/lib/util/runValidations.js and 1 other

To install it, you can run: npm install --save @babel/runtime/helpers/builtin/objectWithoutPropertiesLoose
klis87 commented 6 years ago

@luke-dare I also had this problem, but yarn upgrade fixed this for me. I have all dependencies pinned, so it means that one of subdependencies needs to be upgraded. So, if your deps are pinned, fix is easy. If not, you need to dig in which packages actually need to be upgraded, or just upgrade everything.

neighborhood999 commented 6 years ago

@klis87 Thanks, works fine for me!

macouella commented 6 years ago

Hello, Getting the following error (upgraded to babel 7.0.0-beta.56 today but had to rollback to 55):

ERROR in ./node_modules/yup/lib/util/createValidation.js
Module not found: Error: Can't resolve '@babel/runtime/helpers/builtin/objectWithoutPropertiesLoose' in 'node_modules/yup/lib/util'
 @ ./node_modules/yup/lib/util/createValidation.js 8:60-130
 @ ./node_modules/yup/lib/mixed.js
 @ ./node_modules/yup/lib/index.js
 @ ./src/forms/ProfileForm.js
 @ ./src/_pages/ProfileUpdatePage.js
 @ ./src/App.js
 @ ./src/index.js
 @ multi webpack-hot-middleware/client?reload=true babel-polyfill ./src/index
gforge commented 6 years ago

None of above worked for me.The issue seems to be that the builtin folter has moved to the parent folder helpers. To resolve this I needed to create the folder and copy content of parent into that folder:

cd <project root>
mkdir node_modules/@babel/runtime/helpers/builtin
cp node_modules/@babel/runtime/helpers/* node_modules/@babel/runtime/helpers/builtin/

Fix found on the forum: https://forums.meteor.com/t/error-cannot-find-module-babel-runtime-helpers-builtin-interoprequiredefault/44944/9

This seems to be a beta-issue, hopefully babel will move into RC so that this can be fixed.

renchap commented 6 years ago

Same here with the latest Babel beta. Babel moved some files from beta 55 => beta 56 and it breaks this package, as it depends on "@babel/runtime": "^7.0.0-beta.47" (matching beta 56).

Here is a fix: #272

MufassirShaw commented 6 years ago

GUI version of what @gforge said:

So all you need to do is go to @babel/runtime/helper copy all the content and paste it inside of a folder that should be named builtin. And you have got it fixed (at least mine was).

jquense commented 6 years ago

fixed in 0.26.1

nerdstep commented 6 years ago

Just grabbed 0.26.1 but I'm still seeing the same issue:

./node_modules/yup/lib/Lazy.js
Module not found: Can't resolve '@babel/runtime/helpers/builtin/objectWithoutPropertiesLoose' in 'c:\dev\hyperion\node_modules\yup\lib'
jquense commented 6 years ago

@nerdstep i'd blow away node_modules and install from stratch and see i've tested it a few times locally :/

nerdstep commented 6 years ago

Okay, I did check the version of the pinned dependency in node_modules and it looked correct, but I'll try that and report back.

nerdstep commented 6 years ago

Well, I rmrf'd node_modules & my yarn.lock file but to no avail.

Here's the package.json for my @babel/runtime:

{
  "name": "@babel/runtime",
  "version": "7.0.0-beta.47",
  "description": "babel selfContained runtime",
  "license": "MIT",
  "repository": "https://github.com/babel/babel/tree/master/packages/babel-runtime",
  "author": "Sebastian McKenzie <sebmck@gmail.com>",
  "dependencies": {
    "core-js": "^2.5.3",
    "regenerator-runtime": "^0.11.1"
  },
  "devDependencies": {
    "@babel/core": "7.0.0-beta.47",
    "@babel/helpers": "7.0.0-beta.47",
    "@babel/plugin-transform-runtime": "7.0.0-beta.47",
    "@babel/preset-env": "7.0.0-beta.47",
    "@babel/types": "7.0.0-beta.47"
  }
}

I can also confirm that the file objectWithoutPropertiesLoose.js does not exist in the package.

Here's a repro of the issue.

nerdstep commented 6 years ago

@jquense I believe I found the problem, it looks like objectWithoutPropertiesLoose was only introduced as of babel/runtime 7.0.0-beta.53.

I was able to get my install working by adding the following to my package.json, which tells yarn to override the transitive dependency:

"resolutions": {
    "@babel/runtime": "7.0.0-beta.53"
}
renchap commented 6 years ago

Same error here. I just submitted another PR to update Babel to the newly released RC version, which should allow using Yup with it: #280

jquense commented 6 years ago

try again with 0.26.2

renchap commented 6 years ago

It works … partially.

index.js contains the correct Babel file (https://unpkg.com/yup@0.26.2/lib/index.js), but not customLocale.js (https://unpkg.com/yup@0.26.2/lib/customLocale.js).

It looks like this one has not been regenerated when you pushed the package, I am not sure why.

This causes this error:

./node_modules/yup/lib/customLocale.js
Module not found: Error: Can't resolve '@babel/runtime/helpers/builtin/interopRequireDefault' in '/Users/renchap/dev/Talegraph/node_modules/yup/lib'
jquense commented 6 years ago

Hmm customLocale shouldn't exist anymore it's been changed to setLocale, it must be a left over file that wasn't cleaned weird

renchap commented 6 years ago

Thanks, I guess you need to remove it from your local build before pushing the package.

Could you add an entry to the Changelog for this? I am not the only one who missed this change.

abhi12299 commented 5 years ago

Hey. I was facing the same issue when using react-leaflet. How I fixed it was when I compiled my scripts, it showed me the file name where the import failed. All I did was just fix the import in that file. Eg- if the error was in file Circle.js, I updated the import statement in there to "../../@babel/runtime/helpers/objectWithoutPropertiesLoose"

I had to do this on a couple of files but it worked at the end.