question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m creating a ES2015 (classes and modules) library. I want to use Parsimmon and import it like

import { Parsimmon } from "parsimmon"

To package my application I use Rollup

// rollup.config.js
import resolve from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';

export default {
    input: 'js/export.js',
    output: {
        file: 'dist/ueblueprint.js',
        format: 'es'
    },
    plugins: [
        resolve({ browser: true })//,
        //terser()
    ]
}

The problem is that even though I do set the dependency in NPM

// package.json
{
  "scripts": {
    "build": "rollup --config"
  },
  "devDependencies": {
    "@rollup/plugin-node-resolve": "^13.0.5",
    "rollup": "^2.58.0",
    "rollup-plugin-terser": "^7.0.2",
    "terser": "^5.9.0"
  },
  "dependencies": {
    "parsimmon": "^1.18.0"
  }
}

When I run npm run build, I get the following error [!] Error: 'Parsimmon' is not exported by node_modules\parsimmon\build\parsimmon.umd.min.js, imported by ... I tried both import with curly braced and without

Do you know what it could be?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
barsdevelopercommented, Oct 17, 2021

Hello, thanks for the suggestion but it didn’t work. At the end I could manage to have it bundled using also commonJS https://github.com/rollup/plugins/tree/master/packages/node-resolve#using-with-rollupplugin-commonjs and importing it like import Parsimmon from “parsimmon”

Anyway, thanks. This library is brilliant, it does a lot of work and the packaged size is very small compared to what it offers. Keep up the good work.

0reactions
bd82commented, Oct 17, 2021

What a mess.

Quite so 😆

Read more comments on GitHub >

github_iconTop Results From Across the Web

parsimmon - npm
Parsimmon is a small library for writing big parsers made up of lots of little parsers. The API is inspired by parsec and...
Read more >
parsimmon/API.md at master - GitHub
import { digits, whitespace } from "parsimmon"; var parser = digits.sepBy(whitespace);. Because it can become quite wordy to repeat Parsimmon everywhere:.
Read more >
Fresh Persimmon global imports and top importers 2022 - Tridge
Discover the import data of Fresh Persimmon with wide coverage like top importing countries, markets, prices, and analysis of importing countries.
Read more >
Persimmon Imported (each) Delivery or Pickup Near Me
Get Persimmon Imported delivered to you in as fast as 1 hour via Instacart or choose curbside or in-store pickup. Contactless delivery and...
Read more >
APHIS Proposes Import of Fresh Persimmon Fruit
APHIS Proposes to Allow Persimmon from New Zealand to be Imported into the United States The United States Department of Agriculture's Animal and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found