save-file icon indicating copy to clipboard operation
save-file copied to clipboard

Error while importing save from save-file package

Open Nagasai-Aytha opened this issue 5 years ago • 1 comments

Getting below error Issue 1:

import { save } from 'save-file'

Error: Module '"../../../../../../../xxxxxx/node_modules/save-file"' has no exported member 'save'

import save from 'save-file' Error: This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag

Issue 2: Using const save = require('save-file/sync')

Error: error TS2305: Module '"C://node_modules/save-file/index"' has no exported member 'save'. src/app/.component.ts(6,22): error TS2497: Module '"C:/***/node_modules/save-file/index"' resolves to a non-module entity and cannot be imported using this construct.

Nagasai-Aytha avatar Mar 18 '20 17:03 Nagasai-Aytha

  1. When es modules for node stabilize, I'll include that. https://cdn.pika.dev/save-file works fine for now.
  2. There's no save-file/sync entry anymore, use require('save-file').saveSync instead.

dy avatar Mar 18 '20 22:03 dy