Open iamchriswick opened 3 years ago
window is not defined
You probably have a component or 3rd party plugin that is referencing window (there are various approaches to tackle this).
I don't think this will be specific to Netlify; did you run the build locally?
@davestewart Vanilla Vuepress - all that is done is ejecting the theme. Builds locally, but not on Netlify.
I haven't tried it myself, but you could try running it locally using the Netlify environment:
As it happens, I just switched to Vercel. I spent two weeks battling to optimise performance on Netlify which I discovered on my first deploy on Vercel – was simply never an issue.
Bug report
Steps to reproduce
What is expected?
Build to succeed
What is actually happening?
Build fails
Other relevant information
Netlify Build log: 4:29:35 AM: wait Rendering static HTML... 4:29:35 AM: hello custom theme 4:29:35 AM: [Vue warn]: Failed to resolve async component: function Layout() { 4:29:35 AM: return webpack_require.e(/ import() / 1).then(webpack_require.bind(null, 361)); 4:29:35 AM: } 4:29:35 AM: Reason: ReferenceError: window is not defined 4:29:35 AM: error Error rendering /guides/REST/methods: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /guides/a-resillient-payment-system/: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /guides/authentication/: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /guides/: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /guides/introduction/: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /guides/introduction/interacting-with-the-rest-api: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /reference/: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /reference/merchant-lookup/: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /reference/merchant/: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /samples/: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /guides/REST/status-codes: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /guides/REST/: false 4:29:35 AM: undefined 4:29:35 AM: error Error rendering /config/: false 4:29:35 AM: undefined 4:29:35 AM: Error: render function or template not defined in component: anonymous 4:29:35 AM: at normalizeRender (/opt/build/repo/node_modules/vue-server-renderer/build.dev.js:8262:13) 4:29:35 AM: at renderComponentInner (/opt/build/repo/node_modules/vue-server-renderer/build.dev.js:8412:3) 4:29:35 AM: at renderComponent (/opt/build/repo/node_modules/vue-server-renderer/build.dev.js:8383:5) 4:29:35 AM: at resolve (/opt/build/repo/node_modules/vue-server-renderer/build.dev.js:8451:9)
Output of
npx vuepress info
in my VuePress project: Environment Info:System: OS: Linux 5.8 Pop!_OS 20.10 CPU: (12) x64 AMD Ryzen 9 3950X 16-Core Processor Binaries: Node: 14.15.5 - ~/.nvm/versions/node/v14.15.5/bin/node Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.5/bin/yarn npm: 6.14.11 - ~/.nvm/versions/node/v14.15.5/bin/npm Browsers: Chrome: 88.0.4324.150 Firefox: Not Found npmPackages: @vuepress/core: 1.8.0 @vuepress/theme-default: 1.8.0 vuepress: ^1.8.0 => 1.8.0 npmGlobalPackages: vuepress: Not Found