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

DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at ...node_modules/vuex/package.json. #2040

Closed
Simonl9l opened this issue Aug 15, 2021 · 11 comments
Labels

Comments

@Simonl9l
Copy link

Version

4.0.2

Reproduction link

https://none.git

Steps to reproduce

package.json

{
"name": "myproj",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"serve": "vite preview",
"lint:script": "eslint --ext .ts,vue --ignore-path ../.gitignore --fix .",
"lint:style": "stylelint src/**/.{css,scss,vue} --fix",
"format": "prettier --write ."
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"
.{ts,vue}": "eslint --fix",
".{css,scss,vue}": "stylelint --fix",
"
": "prettier -write"
},
"dependencies": {
"@coreui/icons-pro": "^2.0.3",
"bootstrap": "^5.1.0",
"vue": "^3.2.2",
"vue-router": "^4.0.11",
"vuex": "^4.0.2"
},
"devDependencies": {
"@types/node": "^16.4.13",
"@typescript-eslint/eslint-plugin": "^4.29.0",
"@typescript-eslint/parser": "^4.29.0",
"@vitejs/plugin-legacy": "^1.5.1",
"@vitejs/plugin-vue": "^1.4.0",
"@vitejs/plugin-vue-jsx": "^1.1.7",
"@vue/compiler-sfc": "^3.2.2",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^7.0.0",
"eslint": "^7.32.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-vue": "^7.15.1",
"husky": "^7.0.1",
"lint-staged": "^11.1.2",
"prettier": "^2.3.2",
"sass": "^1.26.5",
"stylelint": "^13.13.1",
"stylelint-config-recommended": "^5.0.0",
"stylelint-config-standard": "^22.0.0",
"typescript": "^4.3.5",
"vite": "^2.4.4",
"vite-plugin-checker": "^0.3.4",
"vite-plugin-eslint": "^1.3.0",
"vls": "^0.7.4",
"vue-tsc": "^0.2.2"
}
}

What is expected?

no warning at startup.

What is actually happening?

per npm run dev.

Update this package.json to use a subpath pattern like "./*".
(Use node --trace-deprecation ... to show where the warning was created)


Building out a template vite/vue3/vuex/vure-router setup...

@Alanscut
Copy link
Contributor

hi @Simonl9l , which version of your Node? I didn't meet this issue, and I test it with version 12.4.0 and 14.15.4

@kiaking
Copy link
Member

kiaking commented Aug 18, 2021

Yeah this happens with the latest node (for me it's 16.6). This is tough one since we can't really remove it and ditch older Node version 😳 Until we find some cool way to stop this warning, we might have to deal with it at the moment.

@kiaking kiaking added the 4.x label Aug 18, 2021
@Simonl9l
Copy link
Author

@Alanscut - I'm on node v16.5.0, so slightly behind @kiaking - its a warning to the sky is not falling, bit one to find the "cool way to stop"...

Thanks for acknowledging the issue is not just me!

@Alanscut
Copy link
Contributor

@Simonl9l it will report an deprecation warning since v15.1.0, https://nodejs.org/api/packages.html#packages_subpath_folder_mappings.

it seems #2048 could deal with this warning

@Simonl9l
Copy link
Author

@Alanscut Looks like it should...when when it will make it to the npm package?

@kiaking
Copy link
Member

kiaking commented Oct 4, 2021

Closed by #2048

@kiaking kiaking closed this as completed Oct 4, 2021
@leonheess
Copy link

Getting this issue with 3.6.2 and Node LTS (16.13.0)

@MatthieuBoxho
Copy link

@leonheess Same here

@trecouvr
Copy link

Getting this issue with 3.6.2 and Node LTS (16.13.0)

Same here on 3.6.2, would it be possible to backport the fix to the 3.x branche ?

@ricardovanlaarhoven
Copy link

Looks like it's already in the 3.x branch
https://github.com/vuejs/vuex/blob/3.x/package.json

Perhaps this was never released to a newer version (3.6.3)?

@dark-kitt
Copy link

The problem still exists ..., after installing vuex 4.0.2 inside of node_modules/vuex/package.json, the export path is still the same.

...
"exports": {
...
  "./": "./"
}
...

After changing it to the example above, the warning disappears.

...
"exports": {
...
  "./": "./"
  "./*": "./*"
}
...

My environment:

...
"engines": {
  "node": "16.16.0",
  "npm": "8.16.0"
},
...

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

No branches or pull requests

8 participants