vikejs / vike

🔨 Flexible, lean, community-driven, dependable, fast Vite-based frontend framework.

Home Page:https://vike.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

__VITE_ASSETS_MAP__ is not defined in plugin

4350pChris opened this issue · comments

Description

The following error occurs starting from version 0.4.162. The following stacktrace is taken from 0.4.163 using vite-plugin-vercel at 4.0.0 and vite at 5.1.4.

Stacktrace

ReferenceError: [vite-plugin-vercel] __VITE_ASSETS_MAP__ is not defined
    at file:///vercel/path0/dist/server/entry.mjs:655:26
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
    at Object.exports.loadServerEntry (/vercel/path0/node_modules/@brillout/vite-plugin-server-entry/dist/importServerEntry/autoImporter.js:2:41)
    at importServerEntry (/vercel/path0/node_modules/@brillout/vite-plugin-server-entry/dist/importServerEntry/index.js:19:13)
    at loadImportBuild (file:///vercel/path0/node_modules/vike/dist/esm/node/runtime/globalContext/loadImportBuild.js:13:9)
    at initGlobalContext (file:///vercel/path0/node_modules/vike/dist/esm/node/runtime/globalContext.js:109:30)
    at getPagesAndRoutes (file:///vercel/path0/node_modules/vike/dist/esm/__internal/index.js:16:5)
    at getPagesWithConfigs (file:///vercel/path0/node_modules/@vite-plugin-vercel/vike/dist/vike.js:226:71) {
  code: 'PLUGIN_ERROR',
  plugin: 'vite-plugin-vercel',
  hook: 'writeBundle'

While this does happen in the vite-plugin-vercel package, it was the upgrade of vike's version that broke it for me and downgrading to 0.4.161 fixes it.

commented

Can you publish a reproduction?

Here you go https://github.com/4350pChris/vike-assets-map-reproduction

I got the error using just this config, which is quite minimal.

commented

Fix pre-released as 0.4.165-commit-2598887.