lsongdev / lsongdev/node-escpos
Statuses.js error
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 443
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I'm encountering the issue below

**My background.js is as follows**

I have checked #297 and tried the fix but it hasn't worked for me
I am using this tutorial -> https://medium.com/@nyorikakar/printing-with-vue-electron-and-node-f52a730e63e7
### Environment
- yarn 1.22.4
- escpos 3.0.0-alpha.6
- escpos-usb 3.0.0-alpha.4
### Steps to reproduce:
1. Install electron builder `vue add electron-builder`
2. Install escpos `yarn add escpos`
3. Add escpos to background.js
4. Run `yarn electron:serve`
### **Full Error Stack**
`⠹ Bundling main process...`
` ERROR Failed to compile with 1 errors 9:02:13 AM`
`error in ./node_modules/escpos/statuses.js`
`Module parse failed: Unexpected token (7:7)`
`You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders`
`|`
`| class DeviceStatus {`
`> byte = '';`
`| bits = [];`
`| bitsAsc = [];`
`@ ./node_modules/escpos/index.js 12:17-38`
`@ ./src/background.js`
`@ multi ./src/background.js`
`ERROR Build failed with errors.`
`error Command failed with exit code 1.`
`info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/background.js and the failing dependency node_modules/escpos/statuses.js, then reproduce the error with yarn electron:serve. Check how the Electron builder handles the class fields shown in statuses.js and compare the result with issue #297. Done means the main process bundles without the parse error while escpos remains usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, javascript, nodejs, webpack
- Domain
- build-system, desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100