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.

Using JSROOT 7 with modern frontend libraries

See original GitHub issue

Hi,

It’s great to see that JSROOT now uses ES modules in the code. It seems to work fine in the web browser (with script[type="module"]) and also with Node.js but I can’t make it work with TypeScript and Angular.

I am trying to update our setup in Phoenix (HSF/phoenix#422) to adapt to the new JSROOT version but the imports are not working correctly.

  1. import { openFile } from 'jsroot/io' doesn’t work because it doesn’t recognize the specified exports in package.json.
  2. If I try to import through the package using import { openFile } from 'jsroot/modules/io.mjs', I get the following error.
    Error: Module not found: Error: Package path ./mo/modules/io.mjs is not exported from package D:\Repos\phoenix\node_modules\jsroot (see exports field in D:\Repos\phix\oenix\node_modules\jsroot\package.json)
    
    I get the same error when trying to compile with webpack.
  3. Importing the file directly using import { openFile } from '../../../../node_modules/jsroot/modules/io.mjs' gives a lot of errors mainly related to Node.js dependencies like fs, path etc.

Do you have any idea how to make JSROOT 7 work in a TypeScript and Angular setup?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:33 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
linevcommented, Jun 24, 2022

@AlbertoPdRF, may be you create new issue?

0reactions
AlbertoPdRFcommented, Jun 24, 2022

It’s free, you can get it from https://code.visualstudio.com/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Syntax highlighting library support for modern frontend ...
I was going to write a post about Svelte and I was checking if it is a language that is supported by the...
Read more >
What Are The Best Frontend Frameworks To Use In 2022?
Compare pros and cons of the best frontend frameworks of 2022: React, Angular, Amber, Vue.js, Svelte, jQuery, Backbone, and Semantic UI.
Read more >
UI library development in the frontend wonderland - Medium
In this post I'll take you through my journey building Yotpo's UI Library — Yotpo's Design System Component Library, the research, the ...
Read more >
Top 10 Popular Frontend Frameworks to Use in 2022
Studies show that the best front-end frameworks are React, Vue, Angular, Svelte, JQuery, Ember, Backbone, Semantic UI, Foundation, ...
Read more >
JavaScript code to an read object from the ROOT file
EVE-7 is a rewrite of EVE for the ROOT-7 era, using modern C++ and ... is based on the FairRoot package while its...
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