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.

Unable to pass latest vega-loader & vega-canvas through Google Closure compiler - missing files?

See original GitHub issue

Hi folks

We’ve discovered a problem with the most recent releases of vega-loader and vega-canvas:

https://github.com/metasoarous/oz/issues/64#issuecomment-698343242

When trying to build cljsjs output for Oz, which involves some minification/tree-shaking with Google Closure (that’s “s”, not “j”; an implementation detail in the ClojureScript ecosystem), it’s not able to find the a certain set of files in the most recent releases of vega-loader and vega-canvas. In particular, the first error that pops up indicates that the vega-loader.js file cannot be found:

{:tag :shadow.build.npm/invalid-override,
 :require-from #object[java.io.File 0x4d68156d ".../node_modules/vega-dataflow/build/vega-dataflow.js"],
 :require "vega-loader",
 :file #object[java.io.File 0x41ebcb92 ".../node_modules/vega-loader/build/vega-loader.node.js"],
 :override "./build/vega-loader.js",
 :override-file #object[java.io.File 0x5d156b61 ".../node_modules/vega-loader/build/vega-loader.js"]}

I realize this doesn’t say anything about vega-canvas, but I’m assuming once the above was fixed the vega-canvas bug popped up. Reverting both packages back one bugfix version has unblocked me for now, but I won’t be able to cut releases with newer versions until the underlying issue is resolved.

I’m a bit clueless as to what might have changed in the build process to be causing this, but hopefully this is enough information for you all to track down what might need fixing. If not, please let me know if there’s any additional context needed which I might be able to help provide.

Thanks for your time!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jheercommented, Oct 1, 2020

Hmm, not sure why that changed, but vega-scenegraph certainly does have a dependency on vega-canvas for handling image loading.

Based on this I’m going to close the issue for now, but happy to have discussion continue as is helpful!

0reactions
metasoarouscommented, Oct 1, 2020

@thheller @domoritz @jheer Thank you all so much for helping to tackle this!

@jheer This appears to have solved the issue with vega-loader, but there may still be a problem with vega-canvas. That is, now when I build with "vega": "5.17.0" without explicitly specifying vega-tooltip or vega-canvas, it doesn’t complain about vega-tooltip, but raises an issue regarding vega-canvas:

The required JS dependency "vega-canvas" is not available, it was required by "node_modules/vega-scenegraph/build/vega-scenegraph.js".

Dependency Trace:
        oz/app.cljs
        oz/core.cljs
        node_modules/vega-embed/build/vega-embed.js
        node_modules/vega/build/vega-node.js
        node_modules/vega-view-transforms/build/vega-view-transforms.js
        node_modules/vega-scenegraph/build/vega-scenegraph.js

Searched for npm packages in:
        /home/csmall/code/oz/node_modules

I seem to be able to require the latest release of vega-canvas (1.2.6) and that gets things working. So maybe this is a somewhat different issue, as previously I didn’t have to explicitly require vega-canvas. Ultimately though, I’m able to get everything building with the most up to date versions, which is fantastic.

Thanks again for all of your hard work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google closure compiler process node_modules
Recent versions of Closure-Compiler support node modules. The compiler will not discover source files - you have to pass the source for each...
Read more >
Frequently Asked Questions | Closure Compiler
Can the Closure Compiler compile JavaScript that's embedded in HTML? No. The Closure Compiler works only on files that contain only JavaScript.
Read more >
Google Closure Guide: Compiling Without Errors - Bendyworks
This series is a step by step guide through Google Closure with a basic starting point and ending up with highly optimized modules...
Read more >
Importing external ES6 modules - Google Groups
I have a project being built with the 20160315 version of the compiler, ... tree to the list of files built with closure...
Read more >
Using Google Closure for Lean and Mean Javascript Projects
Richard Anaya - New Game 2011Creating high quality optimized code in JavaScript has many challenges. Why not have a powerful tool by your ......
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