You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've also noticed this (I use PhpStorm). Can we add some custom JS doc to the exported Proxy to hint to the IDE about the methods? We could even possibly auto-generate these docs.
Hi, is there any update on this issue? I could try but I'm not node expert, so not sure if it would be of any help at all. @Lyrkan the steps you mentioned, are they still valid ? I could try and do something 🙂
I also get this error, but only on one of my two projects.
In my first project (symfony 3 without flex), setOutputPath is correctly resolved.
In my second project (symfony 4 with flex), setOutputPath is unresolved.
I checked both of my projects and noticed that when I install Encore only with npm (or yarn) i get the 0.19.0 version.
But if I install it with flex, I get the 0.17.0 version, and if I forced it to the 0.1.9.0 in my packages.js, the issue is solved.
Activity
Lyrkan commentedon Sep 3, 2017
It looks like it's related to PhpStorm not being able to handle the fact that a
Proxy
is exported:I'm not sure how to solve that.
Edit: Note that this is only an IDE issue, Encore should be working as intended
weaverryan commentedon Oct 12, 2017
I've also noticed this (I use PhpStorm). Can we add some custom JS doc to the exported Proxy to hint to the IDE about the methods? We could even possibly auto-generate these docs.
Lyrkan commentedon Nov 7, 2017
Doing something like that seems to actually work:
So we'd need to:
const
to aclass
(I tried to keep theconst
but for some reason that implied adding a@property
tag for each method of the API)@return {exports}
/@returns {exports}
by@returns {Encore}
@type
tag to themodule.exports
and instantiate the classweaverryan commentedon Nov 15, 2017
That sounds great! Nice find!
I had just started to look into https://github.com/DefinitelyTyped/DefinitelyTyped - i.e. you can create a typescript definition (https://www.npmjs.com/package/@types/webpack) and as soon as it's present, your editor uses it for auto-completion. Pretty cool... but it seems that your solution will work perfectly and is quite simple.
florentdestremau commentedon Feb 8, 2018
Hi, is there any update on this issue? I could try but I'm not node expert, so not sure if it would be of any help at all. @Lyrkan the steps you mentioned, are they still valid ? I could try and do something 🙂
weaverryan commentedon Feb 11, 2018
Do it! I’m sure those steps are still valid - so this is just a chore we need to get done :)
feature #263 Updated Encore object to class for proxy typehinting (fl…
Lyrkan commentedon Feb 12, 2018
Fixed by #263 (make sure your PhpStorm is configured to use ES6 and not ES5), thank you @florentdestremau :)
gaea44 commentedon Apr 3, 2018
I also get this error, but only on one of my two projects.
In my first project (symfony 3 without flex), setOutputPath is correctly resolved.
In my second project (symfony 4 with flex), setOutputPath is unresolved.
I checked both of my projects and noticed that when I install Encore only with npm (or yarn) i get the 0.19.0 version.
But if I install it with flex, I get the 0.17.0 version, and if I forced it to the 0.1.9.0 in my packages.js, the issue is solved.
Hope it helps others.