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

Error upon launching electron app with printer.print #4

Open
kavinvkannan opened this issue Dec 20, 2019 · 0 comments
Open

Error upon launching electron app with printer.print #4

kavinvkannan opened this issue Dec 20, 2019 · 0 comments

Comments

@kavinvkannan
Copy link

I am getting this error when I try to launch the electron app:

Uncaught Exception:TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined at maybeCallback (fs.js:142:9) at Object.writeFile (fs.js:1175:14) at Object.print (/Users/Documents/electron/node_modules/electron-print/index.js:13:6) at App.<anonymous> (/Users/Documents/electron/src/index.js:25:11) at App.emit (events.js:205:15)

Code :

const { app } = require("electron");
const path = require("path");
const printer = require("electron-print");


app.on("ready", function() {
  printer.print("Text sent to printer.");});

Dependencies

"dependencies": {
    "electron-compile": "^6.4.4",
    "electron-print": "^1.0.2",
    "electron-squirrel-startup": "^1.0.0"
  },
  "devDependencies": {
    "@electron-forge/cli": "6.0.0-beta.46",
    "@electron-forge/maker-deb": "6.0.0-beta.46",
    "@electron-forge/maker-rpm": "6.0.0-beta.46",
    "@electron-forge/maker-squirrel": "6.0.0-beta.46",
    "@electron-forge/maker-zip": "6.0.0-beta.46",
    "electron": "6.1.2",
    "electron-prebuilt-compile": "4.0.0"
  }
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

1 participant