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

6.0.0-rc.1 package.json has a valid "main" entry #102

Open
WilliamFalci opened this issue Apr 23, 2021 · 3 comments
Open

6.0.0-rc.1 package.json has a valid "main" entry #102

WilliamFalci opened this issue Apr 23, 2021 · 3 comments

Comments

@WilliamFalci
Copy link

Error:

internal/modules/cjs/loader.js:311
      throw err;
      ^

Error: Cannot find module '/home/b2beuroingro12/Documenti/euroingro-frontend/node_modules/vuex-router-sync/dist/vuex-router-sync.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:303:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at eval (webpack:///external_%22vuex-router-sync%22?:1:18)
    at Object.vuex-router-sync (/home/b2beuroingro12/Documenti/euroingro-frontend/dist/server/js/app.js:10014:1)
    at __webpack_require__ (/home/b2beuroingro12/Documenti/euroingro-frontend/dist/server/js/app.js:27:30)
    at eval (webpack:///./src/app.js?:7:74) {
  code: 'MODULE_NOT_FOUND',
  path: '/home/b2beuroingro12/Documenti/euroingro-frontend/node_modules/vuex-router-sync/package.json',
  requestPath: 'vuex-router-sync'
}

Package.json

{
  "name": "euroingro_frontend",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "build:all": "rm -rf ./dist && npm run build:client && npm run build:server",
    "build:client": "vue-cli-service build --dest dist/client",
    "build:server": "cross-env SSR=1 vue-cli-service build --dest dist/server",
    "start": "node server.js",
    "test:unit": "vue-cli-service test:unit",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "@vue/server-renderer": "^3.0.11",
    "axios": "^0.21.1",
    "bootstrap": "^4.6.0",
    "core-js": "^3.6.5",
    "cross-env": "^7.0.3",
    "cssnano": "^4.1.11",
    "cssnano-preset-default": "^4.0.8",
    "eslint-webpack-plugin": "^2.5.4",
    "express": "^4.17.1",
    "hellojs": "^1.19.2",
    "jquery": "^3.6.0",
    "jsdom": "^16.5.3",
    "mini-css-extract-plugin": "^0.9.0",
    "mutationobserver-shim": "^0.3.7",
    "node-sass": "^5.0.0",
    "postcss": "^8.2.12",
    "postcss-loader": "^4.2.0",
    "postcss-nested": "^5.0.5",
    "primeicons": "^4.1.0",
    "primevue": "^3.3.5",
    "terser-webpack-plugin": "^2.3.8",
    "vue": "^3.0.11",
    "vue-axios": "^3.2.4",
    "vue-debounce": "^2.6.0",
    "vue-router": "^4.0.4",
    "vuex": "^4.0.0-0",
    "vuex-router-sync": "^6.0.0-rc.1",
    "webpack-cli": "^4.6.0",
    "webpack-manifest-plugin": "^3.1.1",
    "webpack-node-externals": "^2.5.2"
  },
  "devDependencies": {
    "@babel/polyfill": "^7.11.5",
    "@fortawesome/fontawesome-free": "^5.15.2",
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~5.0.0-alpha.8",
    "@vue/cli-plugin-router": "^4.5.11",
    "@vue/cli-plugin-vuex": "^4.5.11",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^7.0.0",
    "eslint-plugin-vue": "^7.0.0-0",
    "popper.js": "^1.16.1",
    "sass": "^1.26.11",
    "sass-loader": "^10.0.2",
    "vue-cli-plugin-bootstrap-vue": "^0.7.0",
    "webpack": "^4.0.0"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/vue3-essential",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

Node Version: v14.16.1

@Olli1080
Copy link

You can temporarily fix this by going into node_modules/vuex-router-sync/package.json and replace "main":"dist/vuex-router-sync.js" with "main":"dist/vuex-router-sync.cjs.js"

@denizderman
Copy link

Is vuex-router-sync going to support vue3?

@Olli1080
Copy link

AFAIK it's not needed anymore as you can simply use a getter in your vuex store for the same effect.
E.g.
getters: { route(state) { return router.currentRoute.value } }

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

3 participants