Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Unable find target HTML to render #114

Open
NWYLZW opened this issue Apr 1, 2023 · 1 comment
Open

Bug: Unable find target HTML to render #114

NWYLZW opened this issue Apr 1, 2023 · 1 comment

Comments

@NWYLZW
Copy link

NWYLZW commented Apr 1, 2023

RT

HTML path include vite config base which will unable find target HTML page, because path.realative will compute error

telegram-cloud-photo-size-5-6143281823472530627-y
telegram-cloud-photo-size-5-6143281823472530629-y

const htmlName = path.relative(process.cwd(), excludeBaseUrl)

@xiaohuohumax
Copy link

me too v3.2.1

project path uri:

d:/...../project-name/...........

vite.config.ts:

{
    envDir,
    base: "/project-name",
    plugins: [
        ...,
        createHtmlPlugin({
            pages: [
                {
                    entry: 'src/main.ts',
                    filename: 'index.html',
                    template: 'index.html',
                    injectOptions: {
                        data: {
                            title: "..."
                        }
                    }
                }
            ]
        })
    ],
}

error

 ERROR  [vite:build-html] ejs:8                                                                                               23:12:13  
    6|   <link rel="icon" type="image/svg+xml" href="/logo.png" />
    7|   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 >> 8|   <title><%- title %></title>
    9|   <style>
    10|     :root {
    11|       --app-context-color: #67bc66;

title is not defined

v3.0.6 is ok!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants