routify icon indicating copy to clipboard operation
routify copied to clipboard

<!-- routify:options bundle=true --> make app error

Open oschina opened this issue 3 years ago • 6 comments

bug description when put <!-- routify:options bundle=true --> in pages/_layout.svelte , it build ok, but error happend when visit it.

if remove this, it works.

Error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'name')
    at $e (vendor.f4667ffd.js:4:9323)
    at Object.Un.e.$$.update (vendor.f4667ffd.js:4:23245)
    at an (vendor.f4667ffd.js:4:2556)
    at je (vendor.f4667ffd.js:4:2308)

vendor.f4667ffd.js:4:9323

s=e.componentFile.name.replace(/Proxy<_?(.+)>/,"$1").replace(/^Index$/,e.component.shortPath.split("/").pop())

vite.config.js

import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { resolve }  from 'path';

const production = process.env.NODE_ENV === 'production'

export default defineConfig({
    server: {
        port: 5000
    },

    plugins: [
        svelte({
            emitCss: true,
            compilerOptions: {
                dev: !production,
            },
        })
    ],

    resolve: {
        alias: {
            $api : resolve('./src/api'),
            $components : resolve("./src/components")
        }
    }
});

version Routify 2.18.4, Svelte 3.46.1, vite 2.7.12

screenshot

image

image

oschina avatar Jan 16 '22 11:01 oschina

I download https://github.com/roxiness/routify-starter and add <!-- routify:options bundle=true --> to pages/_layout.svelte

the same error occured.

oschina avatar Jan 16 '22 12:01 oschina

Hi. Would you be able to provide a minimal reproducible for this?

jakobrosenberg avatar Jan 17 '22 19:01 jakobrosenberg

Hi. Would you be able to provide a minimal reproducible for this?

I download https://github.com/roxiness/routify-starter and add <!-- routify:options bundle=true --> to pages/_layout.svelte

build & preview, the same error occured.

oschina avatar Jan 18 '22 07:01 oschina

https://github.com/oschina/routify-starter Here is my demo project , only modify src/public/_layout.svelte to <!-- routify:options bundle=true -->

npm install npm run build npm run preview

open http://localhost:5000 then error happened

oschina avatar Jan 27 '22 13:01 oschina

Same problem here with the routify-starter.

When i execute

npm run dev

I get the following error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'name') at suppressComponentWarnings (index.js:66:34) at Object.$$self.$$.update (Route.svelte? [sm]:106:18) at update (index.mjs:1071:12) at flush (index.mjs:1042:13)

localhost-1646323553978.log

LexShade avatar Mar 03 '22 16:03 LexShade

@jakobrosenberg @ghostdevv Any updates on this? I am facing similar issue!

aakash14goplani avatar Oct 13 '22 11:10 aakash14goplani

I am facing this as well, and removing <!-- routify:options bundle=true --> allows the site to run.

Environment:

theetrain avatar Jan 22 '23 01:01 theetrain

This should be fixed in 2.18.9. Sorry about the delay.

jakobrosenberg avatar Jan 22 '23 11:01 jakobrosenberg

It works now, I appreciate it!

theetrain avatar Jan 22 '23 15:01 theetrain