Comments (8)
This is the error.
I think systemjs was used by grafana(I'm working on developing a grafana panel).
Really want to dive in this issue. Could you give me suggestions. Thanks.
from state-machine-cat.
Is there any workaround? Like instead of npm installing the package, may I include it from /lib?
from state-machine-cat.
hi @Jiajun-Deng - thanks for your interest in state-machine-cat.
My knowledge about angular/ angularjs (or any other FE framework for that matter ...) is quite sporadic - and my knowledge on systemjs is even less, so I might not be the best person in the world to help you with this. Seeing the errors, state-machine-cat isn't the most likely culprit either.
state-machine-cat is a straightforward javascript module, and its main
render
function
shouldn't have any side effects. The only thing that might be off to many other modules is
that is usesviz.js
which is quite a big (>2Mb) dependency (I want to replace it with
something else in the future, but there isn't anything that offers similar functionality...)
You might see webpack complaining about the size. This should not land you with the
errors you see above, though
That said: the three error messages in your screen shot have this in common:
- they're the result of something in the code looking for a module that isn't there
- each of these modules (
fs
,path
andcrypto
) are node core modules. These are indeed indirect dependencies of state-machine-cat - IIRC viz.js includes them).
With its default configuration webpack will include these in the bundle wholesale. That's what's e.g. happening when it creates the bundle for https://state-machine-cat.js.org. Assuming you bundle your app with webpack, that's what should be happening in your case too.
The error message is from system.js (which grafana seems to use for loading plugins), though, which suggests that it's not looking at a webpack bundled thing or your actual bundling works differently...
If you start asking for help in other communities (grafana? systemjs? webpack?) it might be useful to include a few more details about your setup. How do you bundle? What does your webpack config look like? What's actually loaded in the browser? In what shape (bundled, loose files) do you serve your files? How does grafana's plug in system load your .
Some other stuff I've found that might be of help
- It might be useful to adjust your webpack config according to this: https://github.com/systemjs/systemjs#compatibility-with-webpack
- I've googled for
node core modules systemjs
and found a thread from 2014 (prehistoric, so maybe of questionable relevance by now) in the systemjs repo about node core modules and systemjs, and at that point in time it was a bit problematic.
HTH ...
from state-machine-cat.
Hi, @sverweij .Thank you for your reply.
I tried to adjust webpack config but I got these:
`Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.output.libraryTarget should be one of these:
object { auxiliaryComment?, chunkFilename?, crossOriginLoading?, jsonpScriptType?, chunkLoadTimeout?, devtoolFallbackModuleFilenameTemplate?, devtoolLineToLine?, devtoolModuleFilenameTemplate?, filename?, hashDigest?, hashDigestLength?, hashFunction?, hashSalt?, hotUpdateChunkFilename?, hotUpdateFunction?, hotUpdateMainFilename?, jsonpFunction?, library?, libraryTarget?, libraryExport?, path?, pathinfo?, publicPath?, sourceMapFilename?, sourcePrefix?, strictModuleExceptionHandling?, umdNamedDefine? }
-> Type of library`
from state-machine-cat.
I've tried using system.js & the system
libraryTarget
in webpack and that worked ok. Likely you're using a somewhat elder version of webpack (see the systemjs link it ought to be > 4.30.0 for 'system')?
from state-machine-cat.
The libraryTarget of my plugin is 'amd'. I've checked other grafana plugins, they seem to have the same target. So I think amd is required by the grafana API schema?
I updated webpack to 4.0, still the same error.
Is there any operation using fs, path, crypo in smcat? These operations are not supposed to exist in browsers, right?
from state-machine-cat.
So I think amd is required by the grafana API schema?
It doesn't seem likely. That said I have expertise in grafana nor (as said before) in AngularJS
Is there any operation using fs, path, crypo in smcat?
no. but as I mentioned in the first reply, there is in viz.js
These operations are not supposed to exist in browsers, right?
Correct. which is why you use something like webpack, which makes sure the functionality in these packages get bundled with the app you're building. E.g. on state-machine-cat.js.org it does work...
I updated webpack to 4.0, still the same error.
4.0 or 4.30 (or higher)? systemjs documentation explicitly mentions 4.30 or later...
I'm closing this issue as there's no indication the issue you're facing is caused by state-machine-cat (a.o.t. a configuration struggle with systemjs, webpack, grafana). Feel free to re-open if you have concrete evenidence to the contrary.
from state-machine-cat.
Thanks for your reply.
I'm thinking of include your library by using smcat-online-interpreter.min.js as a local .js file. Do you think it is doable?
from state-machine-cat.
Related Issues (20)
- Weighted Edges HOT 4
- TypeError with v9.0.0 HOT 10
- Grammar railroad diagram HOT 4
- Add support for doActivities in SCXML model representation HOT 9
- sm cat syntax does not allow to define multiple initital pseudo-states
- Multiple internal transitions are not rendered nicely HOT 3
- Vim syntax support HOT 3
- Having issue reusing smcat online interpreter
- Add an ESM distribution in addition to CommonJS HOT 3
- Export to png and pdf option HOT 5
- Advantages over PlantUML? HOT 1
- bump fast-xml-parser to >=4.1.2
- [Feature request] Package to anaconda HOT 5
- No "exports" main defined HOT 1
- Example in the documentation for a composite state with history, entry and exit actions and a set of substates HOT 3
- Error while using state-machine-cat in NUXT application HOT 1
- sweep(slow): replace the chai assertion library with node:assert statements HOT 3
- Initial state HOT 2
- How to export the rendered image in python HOT 6
- Is there a way to get a transition note to render inside its parent component? See attached screenshot HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from state-machine-cat.