jspreadsheet / jspreadsheet/ce

Failed Importing the Lib

Open
#1,621 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
7.2k
Forks
890
PR merge metrics
No merged PRs in 30d

Description

Try using this lib, but got error:

<script lang="ts">
import { onMount } from 'svelte';
import jspreadsheet from 'jspreadsheet-ce';
import 'jspreadsheet-ce/dist/jspreadsheet.css';

// Global Variables
export let jsprInst: jspreadsheet.JspreadsheetInstance = null;
export let jsprOpts: jspreadsheet.JSpreadsheetOptions = {};

// Local Variables
let tableEl: HTMLDivElement;
let defaultOpts: jspreadsheet.JSpreadsheetOptions = {
    minDimensions: [1000, 100000]
};

onMount(() => {
    jsprInst = jspreadsheet(tableEl, {...defaultOpts, ...jsprOpts});
});

</script>

<div bind:this={tableEl}></div>

Error:

'default' is not exported by node_modules/jspreadsheet-ce/dist/index.js, imported by src/components/jspreadsheet-ce.svelte
    1: <script lang="ts">
    2: import { onMount } from 'svelte';
    3: import jspreadsheet from 'jspreadsheet-ce';
              ^
    4: import 'jspreadsheet-ce/dist/jspreadsheet.css';
    error during build:
    Error: 'default' is not exported by node_modules/jspreadsheet-ce/dist/index.js, imported by src/components/jspreadsheet-ce.svelte
    ...

Any idea what might happened?
Thanks,

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/components/jspreadsheet-ce.svelte and inspect node_modules/jspreadsheet-ce/dist/index.js, focusing on the import/export mismatch shown by the build error. Reproduce the build with this component and confirm that the import resolves without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.