module-builder icon indicating copy to clipboard operation
module-builder copied to clipboard

Unable to use `addLayout` function when writing Vue components in `TSX` files

Open alSergey opened this issue 1 year ago • 3 comments

Describe the bug

I cannot include a file without an extension in addLayout function, otherwise the following error will occur when running the npm run prepack command:

ℹ Building my-module
ℹ Cleaning dist directory: ./dist 
Could not map moduleDetection force

ERROR  Template not found: /Users/seralekhin/Desktop/simple-module/src/runtime/layouts/auth    

If I try to specify the js extension, the npm run prepack command also fails with an error:

ℹ Building my-module
ℹ Cleaning dist directory: ./dist
Could not map moduleDetection force

ERROR  Template not found: /Users/seralekhin/Desktop/simple-module/src/runtime/layouts/auth.js  

If I try to specify the tsx extension, the npm run prepack command succeeds, but then there is a problem in the project:

ERROR  Cannot start nuxt:  Template not found: /Users/seralekhin/Desktop/simple-module/dist/runtime/layouts/auth.tsx

Reproduction

Open StackBlitz and go to dist/module.mjs

alSergey avatar Jun 17 '24 11:06 alSergey