You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run electron . the app works perfectly, however when I run next build renderer && next export renderer (specifically the next export command) I get the following log:
Note: all of my client code lives in /renderer
[00:22:52] Compiling client
[00:22:52] Compiling server
[00:22:52] Compiled server in 792ms
[00:22:55] Compiled client in 4s
> using build directory: D:\klipped\renderer\.next
copying "static build" directory
> exporting path: /start
> exporting path: /file
TypeError: Cannot read property 'send' of undefined
at D:\klipped\renderer\.next\server\static\lXCFzg2cjgmkVrnUKjqkQ\pages\file.js:358:39
at new Promise (<anonymous>)
at resolveFilePath (D:\klipped\renderer\.next\server\static\lXCFzg2cjgmkVrnUKjqkQ\pages\file.js:357:10)
at Function._callee$ (D:\klipped\renderer\.next\server\static\lXCFzg2cjgmkVrnUKjqkQ\pages\file.js:307:24)
at tryCatch (D:\klipped\node_modules\regenerator-runtime\runtime.js:62:40)
at Generator.invoke [as _invoke] (D:\klipped\node_modules\regenerator-runtime\runtime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (D:\klipped\node_modules\regenerator-runtime\runtime.js:114:21)
at asyncGeneratorStep (D:\klipped\renderer\.next\server\static\lXCFzg2cjgmkVrnUKjqkQ\pages\file.js:228:103)
at _next (D:\klipped\renderer\.next\server\static\lXCFzg2cjgmkVrnUKjqkQ\pages\file.js:230:194)
at D:\klipped\renderer\.next\server\static\lXCFzg2cjgmkVrnUKjqkQ\pages\file.js:230:364
Export successful
import{ipcRenderer}from'electron'import{Component}from'react'import{FileDraggable}from'../components/file-draggable'importErrorfrom'next/error'exportdefaultclassFileextendsComponent{staticasyncgetInitialProps({ query }){letfilePathtry{if(query.name){filePath=awaitresolveFilePath({data: query.data,name: query.name})}else{filePath=awaitresolveFilePath({data: query.data})}}catch(err){console.error(err)return{error: 'Failed to save file.'}}return{ filePath,data: query.data,name: query.name}}render(){returnthis.props.error
? <ErrorstatusCode={500}/>// TODO: Custom error component
: <FileDraggablefilePath={this.props.filePath}name={this.props.name}/>}}functionresolveFilePath({ data, name }){returnnewPromise((resolve,reject)=>{ipcRenderer.send('data',{ data, name })ipcRenderer.on('file',(_,filePath)=>resolve(filePath))ipcRenderer.on('error',err=>reject(err))})}
The text was updated successfully, but these errors were encountered:
tom-sherman
changed the title
Typeerror when running next export
"TypeError: Cannot read property 'send' of undefined" when running next export
Dec 24, 2018
When I run
electron .
the app works perfectly, however when I runnext build renderer && next export renderer
(specifically thenext export
command) I get the following log:Note: all of my client code lives in
/renderer
Here's my code:
next.config.js
file.js
The text was updated successfully, but these errors were encountered: