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

quick start not working? SyntaxError: Named export 'EncodingMode' not found. #103

Open
wivaku opened this issue Aug 8, 2022 · 0 comments
Labels

Comments

@wivaku
Copy link

wivaku commented Aug 8, 2022

Using quick start example:

import {
  OutputOption,
  EncodingMode,
  SymbologyType,
  createStream
} from 'symbology'

(async () => {
  try {
    const { data } = await createFile({
      symbology: SymbologyType.CODE128,
      encoding: EncodingMode.GS1_MODE,
      fileName: 'out.svg',
      backgroundColor: '00000000',
      foregroundColor: '00FF00FF'
    }, '12345')

    console.log('File successfully created.')
  } catch (err) {
    console.error('Error: ', err)
  }
})()

Results in error message:

$ node --version ## result: v16.16.0
$ yarn add symbology
$ node quick_start_symbology.js
file:///.../quick_start_symbology.js:3
	EncodingMode,
	^^^^^^^^^^^^
SyntaxError: Named export 'EncodingMode' not found. The requested module 'symbology' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'symbology';

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
    at async loadESM (node:internal/process/esm_loader:88:5)
    at async handleMainPromise (node:internal/modules/run_main:61:12)

Am I doing something wrong?

@jshor jshor added the bug label Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants