mrodal / vue-inheritance-loader

Webpack loader to be used along with vue-loader for Single File Components that provides template extension
38 stars 5 forks source link

alias problems... #14

Closed chumager closed 4 years ago

chumager commented 4 years ago

Hi, how are you?

I've a new problem...

Since I've started using your loader I were always in dev mode with hot reloading... there were no problems since the last change and all was fine.

Today I've to transpile to publish and there were an error with the "extends" resolution.

I've and alias for mi FW.

      resolve: {
        extensions: [".js", ".vue", ".json"],
        alias: {
          itdfw: itdfwPath,
          default: "/var/www/itdfw/DEFAULT/vue/src",
        },
      },

I works well in all my client site, and it also works well with extends in dev mode. but when I builded the site I got this error:

 ERROR  Failed to compile with 1 errors                                                                13:18:40

 error  in ./src/components/Area.vue?vue&type=script&lang=js&

Module build failed (from ./.yarn/$$virtual/thread-loader-virtual-ef62e45dc5/6/home/jcmunoz/.yarn/berry/cache/thread-loader-npm-2.1.3-ed21f3c893-2.zip/node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
ENOENT: no such file or directory, open '/var/www/itdfw/dobleimpacto.itdmovil.cl/vue/src/components/itdfw/components/GenericInput.vue'
    at PoolWorker.fromErrorObj (/var/www/itdfw/dobleimpacto.itdmovil.cl/vue/.yarn/$$virtual/thread-loader-virtual-ef62e45dc5/6/home/jcmunoz/.yarn/berry/cache/thread-loader-npm-2.1.3-ed21f3c893-2.zip/node_modules/thread-loader/dist/WorkerPool.js:262:12)

you can see the alias is not working.

but if I instead use the module name of mi fw:

 warning  in ./src/components/Area.vue

Module build failed (from ./.yarn/unplugged/vue-inheritance-loader-virtual-da37d749a7/node_modules/vue-inheritance-loader/src/index.js):
Error: ENOENT: no such file or directory, open '/var/www/itdfw/dobleimpacto.itdmovil.cl/vue/src/components/@chumager/itdfw-site-base/components/GenericInput.vue'

 @ ./src lazy ^\.\/.*$ namespace object
 @ /home/jcmunoz/Develop/node.js/itdfw-site-base/src/ITDImport.js
 @ /home/jcmunoz/Develop/node.js/itdfw-site-base/src/ITDmain.js
 @ ./src/main.js
 @ multi ./src/main.js

In resume, it I use alias I got error and can't build, if I use module name, I get a warning and the component doesn't show at all.

I'll look if it could be a "link" problem from my module (it has yarn link to avoid upload the module all the time), but I doubt it because it has always worked.

I didn't review If it could be a problem in other place because the only components with problems are those how uses extends and the path is an alias.

Let me know if I can help you some way.

Best regards.

chumager commented 4 years ago

If I build in develop mode, then there is no problem... that's why in dev it works well and the build have problems, but the size is HUGE...

I'll try to find out more about the differences.

Regards.

mrodal commented 4 years ago

I don't know about the first error, but the second one its fixed now, please try with the new version.

I made this loader for a project that is no longer active, and I'm not using it anywhere now, that's why you find these errors.

I see that you are using it in a big project, it would be nice if you could study the code and how this loader works so that you don't depend on me and can help with maintaining it and submitting PRs when you find problems like this one. Count on me to help you if something isn't clear in the code and needs some explaining!

chumager commented 4 years ago

Hi, I studied your code and understood it, my problem here is the use of inner functions and variables from the webpack loaders...

I really appreciate your effort for helping and if you just stopped working on this module I can take charge of it... for me it's a very important part of my project and if you don't need to maintain it no more... I can take it from now on...

Regards.

mrodal commented 4 years ago

Great, I sent you an invite to have write access to the repo

chumager commented 4 years ago

Hi, sorry but I didn't see the invitation in my email and now it's expired... can You send me another one?

Best regards...

mrodal commented 4 years ago

done