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

[Critical] - Build is failing. Missing dependency nuxt-property-decorator #44

Closed
AndrewBogdanovTSS opened this issue Mar 23, 2018 · 27 comments

Comments

@AndrewBogdanovTSS
Copy link

AndrewBogdanovTSS commented Mar 23, 2018

Steps to reproduce:
Clone repo using vue-cli
Install dependency with npm/yarn
Run npm run dev

ERROR Failed to compile with 2 errors12:32:38

This dependency was not found:

  • nuxt-property-decorator in ./node_modules/ts-loader?{"appendTsSuffixTo":[{}]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./components/Card.vue, ./node_modules/ts-loader?{"appendTsSuffixTo":[{}]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./pages/index.vue

To install it, you can run: npm install --save nuxt-property-decorator

nuxt-property-decorator is present in node_modules folder, but it seems that it's broken. It references some unexistent entry point in package.json nuxt-property-decorator.umd
I have strong doubts on whether it should be used instead of nuxt-class-component + vue-property-decorator although it seems logical, the dependency itself is quite problematic

This question is available on Nuxt.js community (#c33)
@nysos3
Copy link

nysos3 commented Mar 23, 2018

Looks like my bugfix was merged in. Once David publishes the changes, this issue should be fixed. 🎉

nysos3 added a commit to nysos3/typescript-template that referenced this issue Mar 23, 2018
@AndrewBogdanovTSS
Copy link
Author

But what exactly you've changed? Is it only the version number in package.json?

@nysos3
Copy link

nysos3 commented Mar 23, 2018

Yes, this is the version number that DavidBernal published with the fix to this issue.

This issue was the fault of nuxt-property-decorator not publishing the file defined in the main variable of package.json, meaning this dependency was never truly resolved. nuxt-property-decorator version 1.1.3 fixes this issue, thus I updated the dependency of this template.

@AnthoniG
Copy link

AnthoniG commented Mar 25, 2018

I am still getting this error
Fresh install of nuxy and the template

 ERROR  Failed to compile with 2 errors                                 20:40:08

This dependency was not found:

* nuxt-property-decorator in ./node_modules/ts-loader?{"appendTsSuffixTo":[{}]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./components/Card.vue, ./node_modules/ts-loader?{"appendTsSuffixTo":[{}]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./pages/index.vue

To install it, you can run: npm install --save nuxt-property-decorator

Even when I install nuxt-property-decorator it still fails with the same message

Any clues on how to fix ?

cat package.json 
{
  "name": "my-project",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@nuxtjs/axios": "^5.0.0",
    "nuxt": "^1.3.0",
    "nuxt-property-decorator": "^1.1.4",
    "vuex-class": "^0.3.0"
  },
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate"
  },
  "devDependencies": {
    "@types/node": "^9.4.6",
    "ts-loader": "^3.5.0",
    "typescript": "^2.7.2"
  }
}

EDIT: Just to add, I was running the dev to see the output. Not run build

@DevinZhong
Copy link

In package.json, setting the version of nuxt-property-decorator to 1.1.3 resolve my problem.
Be careful, it is not ^1.1.3, because the 1.1.4 version still failed for me. @AnthoniG

@AnthoniG
Copy link

@DevinZhong Thanks. Will give that a go and report back 😺

@AndrewBogdanovTSS
Copy link
Author

@DevinZhong it's not really a fix for the issue. The only way this issue can be resolved is by fixing nuxt-property-decorator

@mzohrab
Copy link

mzohrab commented Mar 28, 2018

@AndrewBogdanovTSS is right, project will compile with this fix, but will fail in runtime.

@DevinZhong
Copy link

@AndrewBogdanovTSS oh, yes, you're right! It failed in runtime finally. Forgive my carelessness.

@AnthoniG
Copy link

So, we are still no further forward ?

@AndrewBogdanovTSS
Copy link
Author

Someone needs to take ownership of nuxt-property-decorator. Current owner is unable to support it further. @Atinux maybe you could take it under your wing?

@AnthoniG
Copy link

AnthoniG commented Mar 29, 2018

Used nuxt-property-decorator@1.1.3 this is what it spat out

SyntaxError: Unexpected token import
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:607:28)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at r (/home/anthoni/projects/poc/nuxt-typescript/node_modules/vue-server-renderer/build.js:8330:16)
    at Object.<anonymous> (server-bundle.js:3968:18)
    at __webpack_require__ (webpack:/webpack/bootstrap c0a523f432117413fbbe:25:0)
    at Object.59 (pages/index.vue?c13f:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap c0a523f432117413fbbe:25:0)
    at Object.56 (pages/index.vue:1:0)
    at __webpack_require__ (webpack:/webpack/bootstrap c0a523f432117413fbbe:25:0)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) statusCode: 500, name: 'SyntaxError' }

Definately seems to be a problem with that package but not sure what.

@hartmut-co-uk
Copy link

That should help? Would there be any reason not to do this?
nuxt-community/nuxt-property-decorator#9

Still would require whatever changed from 1.1.3 -> 1.1.4 to be rolled back / fixed...

@hartmut-co-uk
Copy link

@hartmut-co-uk
Copy link

hmm not sure this actually works - breaks somewhere else now... :(

Babel compiled version 1.1.3 works fine though...
https://babeljs.io/repl/#?babili=false&browsers=&build=&builtIns=false&code_lz=OQVwzgpgBGAuBOBLAxrYBuAUIgtgBwHt5YoA1EaAM3gJymADcKNt8iSBhWwgOwh9gAaKAG8oyeBACGsCABEIyIjKJQAvlGq16TCAFpkAGylgwB7gT4CWXNldgA6SQHNEcCPAASBAgGswABQA2phQYfQARhCURBAASgQgsgCiAh7AgqHhwFExkglJEAAy0gwQGVlhwCYAnjzIcjJSFeH0lBCwyAAWLdld0gAmvVU4iAMDhhAA7lKSw_TGNYloma3ACFI8YIiwiJbzwGASBIaGACoEF3gHDFKGYzLlmAC6AJRYAPQf4pZwULa8fgkAC8UEkAEcQIhJAFgDwQAAPWAGYymcx2IHAd6YL4_LYkMQSaSyBRKeAqeDqKCgiFQmFwxHIowmMxKDHWbG4QjEeiSSiTVB6HAdKQDJosD4AKkloUlUAGimUsF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5NKyF0YMarbcZsYGFbYuQ7YQDnSA4AGb7cZXYIEDA3Z9ReaQFg5hBU64G8EEFrYfS_ac68757hDM6g5g5vSQ7Q5Q5nBw4I75jADI5_Bo54SHbY7lAoH45oH2L7wkEEj_B4rCBSq8pAA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&lineWrap=true&presets=es2015%2Creact%2Cstage-2&prettier=false&targets=&version=6.26.0&envVersion=

@RaZeR-RBI
Copy link

RaZeR-RBI commented Mar 31, 2018

Just stumbled upon this issue too.
Tried every version from the npm, only 1.1.3 and 1.0.0 compile on my machine.
Version 1.0.0 didn't give any runtime errors for me (at least I'm able to see the starter page) - so I guess it's worth to try and maybe it'll work for you 😉

@AnthoniG
Copy link

@RaZeR-RBI Did not drop the version that far but will give it a go.
1.1.3 did not work on my machine. Just gave me errors 😢

@AnthoniG
Copy link

Getting a different error now. This is also with or without the nuxt-property-decorator (IE, it makes no difference if there or not)

 ERROR  Failed to compile with 1 errors                                 20:13:43

 error  in ./pages/index.vue

Module build failed: Error: Could not find file: '/home/anthoni/projects/poc/test-project/pages/index.vue'.
    at getValidSourceFile (/home/anthoni/projects/poc/test-project/node_modules/typescript/lib/typescript.js:103059:23)
    at Object.getEmitOutput (/home/anthoni/projects/poc/test-project/node_modules/typescript/lib/typescript.js:103402:30)
    at Object.getEmitOutput (/home/anthoni/projects/poc/test-project/node_modules/ts-loader/dist/instances.js:155:41)
    at getEmit (/home/anthoni/projects/poc/test-project/node_modules/ts-loader/dist/index.js:172:35)
    at successLoader (/home/anthoni/projects/poc/test-project/node_modules/ts-loader/dist/index.js:42:11)
    at Object.loader (/home/anthoni/projects/poc/test-project/node_modules/ts-loader/dist/index.js:29:12)

 @ ./pages/index.vue 8:0-99 9:0-112
 @ ./.nuxt/router.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?name=client&reload=true&timeout=30000&path=/__webpack_hmr ./.nuxt/client.js

@timrijkse
Copy link

I managed to get it working by using nuxt-property-decorator version 1.0.0. Having another error now though:

client.js:100 Uncaught ReferenceError: Vue is not defined
    at Object../.nuxt/client.js (client.js:100)
    at __webpack_require__ (bootstrap 74b87c81ea724e5796b9:712)
    at fn (bootstrap 74b87c81ea724e5796b9:117)
    at Object.0 (index.ts:61)
    at __webpack_require__ (bootstrap 74b87c81ea724e5796b9:712)
    at webpackJsonpCallback (bootstrap 74b87c81ea724e5796b9:25)
    at app.js:1

@hartmut-co-uk
Copy link

Hi @timrijkse - I run into that, too.

Try replacing
test: /((client|server)\.js)|(\.tsx?)$/
with
test: /.tsx?$/,
(https://github.com/nuxt-community/typescript-template/blob/master/template/modules/typescript.js#L16)

I'm not sure why that has been changed / added.

@moritzsternemann
Copy link

Is there an ETA for a fix for this, now that you've taken over nuxt-property-decorator @breakingrobot @Atinux?
Or is there anything I can do to speed up the process?

@breakingrobot
Copy link
Contributor

@moritzsternemann If you have clue or a PR, I'll review it and merge it 👍

@moritzsternemann
Copy link

I created nuxt-community/nuxt-property-decorator#10 to go on from there. Couldn't figure out what exactly the problem is...
@breakingrobot

@SuperHuangXu
Copy link

各位大佬加油修复bug啊~~~

@makyo-dev
Copy link

  • node -v: v8.10.0
  • yarn -v: 1.5.1
This dependency was not found:

* nuxt-property-decorator in ./node_modules/ts-loader?{"appendTsSuffixTo":[{}]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./compon
ents/Card.vue, ./node_modules/ts-loader?{"appendTsSuffixTo":[{}]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./pages/index.vue

To install it, you can run: npm install --save nuxt-property-decorator
$ cat ./node_modules/nuxt-property-decorator/package.json | grep version
  "version": "1.1.4",
$ tree ./node_modules/nuxt-property-decorator
./node_modules/nuxt-property-decorator
├── lib
│   ├── nuxt-property-decorator.d.ts
│   └── nuxt-property-decorator.js
├── LICENSE
├── package.json
└── README.md

package.json

"main": "lib/nuxt-property-decorator.umd.js",
"scripts": {
  "build": "tsc -p src/tsconfig.json && npm run build:umd",
  "build:umd": "rollup -c",
},

File lib/nuxt-property-decorator.umd.js does not exists in lib directory

Seems like command ... && npm run build:umd not executed when package is published. But if npm run build locally it works fine and lib contains lib/nuxt-property-decorator.umd.js

With locally builded can check by:

$ yarn add makyo-dev/nuxt-property-decorator

@alidcast
Copy link

@timrijkse @hartmut-co-uk the vue not found error is also found in Nuxt typescript example which doesn't use nuxt-property-decorator (and uses nuxt-class-component and vue-property-decorator instead

@breakingrobot
Copy link
Contributor

This is fixed as of nuxt-property-decorator@1.2.0 👍 🎊

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