用vue服务器渲染的问题

发布于 2022-09-04 21:03:49 字数 2657 浏览 19 评论 0

<% for (var chunk of webpack.chunks) {
    for (var file of chunk.files) {
      if (file.match(/\.(js|css)$/)) { %>
<link rel="<%= chunk.initial?'preload':'prefetch' %>" href="<%= htmlWebpackPlugin.files.publicPath + file %>" as="<%= file.match(/\.css$/)?'style':'script' %>"><% }}} %>

报错信息

/home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._lodash.template@4.4.0@lodash.template/index.js:1097
    throw result;
    ^

SyntaxError: Unexpected token =
    at Function (<anonymous>)
    at /home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._lodash.template@4.4.0@lodash.template/index.js:1089:12
    at apply (/home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._lodash.template@4.4.0@lodash.template/index.js:74:25)
    at /home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._lodash.template@4.4.0@lodash.template/index.js:1126:12
    at apply (/home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._lodash.template@4.4.0@lodash.template/index.js:76:25)
    at /home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._lodash.template@4.4.0@lodash.template/index.js:317:12
    at template (/home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._lodash.template@4.4.0@lodash.template/index.js:1088:16)
    at parseTemplate (/home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._vue-server-renderer@2.3.0@vue-server-renderer/build.js:1867:11)
    at new TemplateRenderer (/home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._vue-server-renderer@2.3.0@vue-server-renderer/build.js:1938:7)
    at createRenderer$1 (/home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._vue-server-renderer@2.3.0@vue-server-renderer/build.js:5658:26)
    at createRenderer$$1 (/home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._vue-server-renderer@2.3.0@vue-server-renderer/build.js:6037:10)
    at Object.createBundleRenderer (/home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._vue-server-renderer@2.3.0@vue-server-renderer/build.js:5969:20)
    at createRenderer (/home/hldev/IdeaProjects/intelligence-system-frontend/server.js:36:43)
    at require (/home/hldev/IdeaProjects/intelligence-system-frontend/server.js:30:20)
    at Compiler.clientCompiler.plugin (/home/hldev/IdeaProjects/intelligence-system-frontend/build/setup-dev-server.js:32:9)
    at Compiler.applyPlugins (/home/hldev/IdeaProjects/intelligence-system-frontend/node_modules/._tapable@0.2.6@tapable/lib/Tapable.js:61:14)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

芸娘子的小脾气 2022-09-11 21:03:49

这关vue服务器渲染什么关系呢.

酷遇一生 2022-09-11 21:03:49

你好,请问这个问题后来解决了吗,我也是服务端渲染端时候碰到这个问题

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文