Cannot load pages nor components

Hi,
routes: [
{
path: ‘/about/’,
component: About,
},
{
name:‘about2’,
path: ‘/about2/’,
url: ‘./pages/about.html’,
},
],

about2 never loads: I just have pageInit event and I see the transition effect.
Whatever is the url, I got the same result. I tried almost every possibility.

Now I also have a problem with about component loading

import About from ‘…/pages/about.html’;
about gives me error:

parse-component.js:14 Uncaught (in promise) TypeError: Cannot read property ‘2’ of null
at parseComponent (parse-component.js:14)
at Object.parse (component.js:27)
at component-loader.js:69

const templateType = hasTemplate[2] || ‘t7’;

Any idea ?

PS. I use parceljs

When using webpack (from f7-cli, I got that error in console:

http://localhost:8080/pages/about.f7.html 404 not found

Looks like webpack needs some extra configuration to load pages. Is there are sample included somewhere ?

You are misunderstood concepts.

  • You can use import only when you use it with webpack. It works like ES modules, and import path should be relative to the file where you import it
  • You can use componentUrl when you DO NOT use webpack, and path here should be relative to your app root (e.g. webserver), because this is resolved on runtime in browser and it doesn’t know anything about your files structure

Thanks. That make sense.

However I guess this can be also done with webpack if you configure webpack and say where to retrieve files from .