stencil-community / stencil-app-starter

Minimal starter project for building web components with Stencil
https://github.com/ionic-team/stencil
MIT License
320 stars 102 forks source link

Prerendering not working #62

Closed matteobortolazzo closed 2 years ago

matteobortolazzo commented 5 years ago

With @stencil/core@0.16.0 running

 stencil build --prerender 

gives the following error:

[ ERROR ]  TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined at
           Url.parse (url.js:152:11) at Object.urlParse [as parse] (url.js:146:13) at getWritePathFromUrl
           (C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\compiler\index.js:8936:38)
           at
           C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\compiler\index.js:15262:26
           at Generator.next (<anonymous>) at
           C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\compiler\index.js:32:71 at
           new Promise (<anonymous>) at __awaiter
           (C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\compiler\index.js:28:12)
           at writePrerenderDest
           (C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\compiler\index.js:15260:12)
           at
           C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\compiler\index.js:15246:19

[ ERROR ]  evalmachine.<anonymous>:4 })(x,r); ^ ReferenceError: x is not defined at evalmachine.<anonymous>:4:4 at
           evalmachine.<anonymous>:5:3 at Script.runInContext (vm.js:107:20) at Object.runInContext (vm.js:285:6) at
           Object.runInContext
           (C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\sys\node\index.js:1:13735)
           at runGlobalScripts
           (C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\compiler\index.js:13557:23)
           at createPlatformServer
           (C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\compiler\index.js:13360:5)
           at resolve
           (C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\compiler\index.js:13639:21)
           at new Promise (<anonymous>) at hydrateHtml
           (C:\Users\borto\Documents\GitHub\blog-pwa-example\node_modules\@stencil\core\dist\compiler\index.js:13622:12)
arturh85 commented 5 years ago

Same with stencil 0.17.0 nodejs 11.6.0 EDIT: also with 0.17.1-0

david-poindexter commented 2 years ago

I performed the following test and was unable to reproduce the issue.

I updated package.json to add a prerender script.

image

NOTE: I had to do it this way due to a stencil CLI conflict due to some recent BigCommerce development - which also has a stencil CLI. 😉

I then ran npm run prerender and it produced the following results.

image

Since this appears to be working now, we'll go ahead and close this issue.