I’m trying to use Plotly.js with Stencil, but one of Plotly’s dependencies uses glslify, which apparently has an “Octal literal in strict mode”. Is no one else using Plotly with Stencil, or is there another way to get past this issue? I’m currently using the @types/plotly.js TypeScript types and running on Windows using the Stencil app template.
[ ERROR ] Rollup: Parse Error
Octal literal in strict mode (Note that you need plugins to import files that are not
JavaScript) 1: export default
'...\node_modules\glslify' ^
I saw the note about Strict Mode, but I am not sure how to lobby the authors for such a large package.
Below is how i solve this problem for my to be app by importing it as external module loaded via script tag,
this way the typescript compiler will exclude plotly.js-dist and only include @types/plotly.js for the ambient declaration.
Seems this works great for an app. However, when I tried to move my components to a library, Stencil tries to load plotly.js, which is not there. I cannot determine why it won’t ignore the dependency.
Uncaught TypeError: Cannot set property 'traces' of undefined
at HTMLDocument.<anonymous> ((index):24)
index-1eb1703e.js:2694 TypeError: Failed to resolve module specifier "plotly.js". Relative references must start with either "/", "./", or "../". undefined
consoleError @ index-1eb1703e.js:2694
index-1eb1703e.js:1938 Uncaught (in promise) Error: Constructor for "plotly-plot#undefined" was not found
at initializeComponent (index-1eb1703e.js:1938)