I am trying to load plotly.js on the client side in my angular2-meteor app (Meteor 1.3), and I can't figure out how to do so.
I've tried many variations of imports 'plotly.js', import { Plotly } from 'plotly.js' and so on, but none of them seem to work on the client (did not test on server so far).
The file that imports plotly is in the imports folder, so that I can use it either on server or on client.
Compiler gives me "Cannot find module 'plotly.js'" for most of my tries, imports 'plotly.js' gives no error message, but the Plotly object is not defined.
Do you have any solution ? I'd like a real solution more than a quickfix or CDN loading, as this kind of issue seems to appear with a lot of npm packages. Thanks a lot !
Related
So I have a project on vue 3, in with was requested to add metadata(og, and twitter), so has been a long week, due I never had to work with something like that before, and it seems there are only 2 options available as I can see, so I have chose to work with usevue/head plugin, however the SSR part was not clear in the documentation, assuming that you already know. So after a long research, testing, and watching tutorials, I found how to, the component rendering to head was the easy part and is done(in my main project not in this repository, because my project I still don't have the ssr part and it's what I'm trying to figure out).
However for the SSR I created a empty project(check repository here) where I just want to run the server together with the plugin example code from the documentation, however now I'm facing 2 issues:
For some reason the css coming from the components is not being "compile" by the server.
More important, when importing the usevue/head plugin into the project I got an error: "UnhandledPromiseRejectionWarning: ReferenceError: useHead is not defined"
I suppose is because now I have 2 "main" js files, one for the server, and one for the client side, so I'm guessing that I need to import somehow the plugin to the main.server one as well, which currently looks like that:
import App from './App.vue'
export default App;
While my client side one looks like:
import { createApp } from 'vue'
import App from './App.vue'
import { createHead } from '#vueuse/head'
const head = createHead();
createApp(App).use(head).mount('#app');
If I am guessing correctly, the question is, how do you include in general a third party plugin in a server side file, not to mention the router?
Thank you in advance for your help. Also if you can recommend something else, also is very welcome.
I did npm install on the folder with the react content. I'm not using webpack or bundler I pretty much went off this tutorial for setup, because I only need React as components https://reactjs.net/getting-started/aspnet.html and get this error
$exception {"Error while loading \"~/Scripts/react/Components/Progression/ProgressionTable.js\": SyntaxError: Unexpected identifier\r\n at ProgressionTable.js:14:8 -> import Modal from 'react-bootstrap';"} React.Exceptions.ReactScriptLoadException
so essentially it's complaining about the 'import' statement and it always does this for any import. What do I do?
In short import is not supported JS by the browsers so you need to use webpack/babel-loader to turn those import statements into JS that still works.
You would have to use a browser based loader like Require.JS to get your existing code to work here, but your better off having a look at enabling module import loading via Webpack/Babel.
To sum it up, having the right tooling in place will prevent import statements in your compile JS code that the browser has no idea how to handle.
I created a PremierePro Extension which could download and import a file to a project. The same extension unfortunately does not work under Photoshop, because the host scripts app instance doesn't contain a project. I tried out different formats like .psd, but no project appears.
hostScript.jsx:
app.project // === null
I import the file I downloaded by this command:
csInterface.evalScript("app.project.importFiles(['" + fullPath + "'])");
Due to the fact that I can't debug the host scripts I'm a bit stucked.
I havn't found an example of importing files to photoshop either.
Does anyone have a clue how to import a file to photoshop, or is there another way to create a explicit project?
Photoshop doesn't have projects, in fact dom for all of the Adobe products is slightly different. You can check PS JS reference (https://wwwimages2.adobe.com/content/dam/acom/en/devnet/photoshop/pdfs/photoshop-cc-javascript-ref.pdf) for more info. For example you can open files with app.open().
To debug hostscripts I encapsulate everything to functions with try-catch (and never call for dom functions from csinterface), but I think there're also more comprehensive solutions.
It's just the open command:
csInterface.evalScript("app.open(File('" + encodeURIComponent(fullPath) + "'));");
I am just starting with Meteor and working on an existing project. I am running into an issue with one of the packages(observatory-apollo) that's has the following line:
__meteor_bootstrap__.app.use Observatory.logger #TLog.useragent
It is complaining that __meteor_bootstrap__.app is undefined.
What is __meteor_boostrap__ exactly? I can't seem to find a description of what it is but from threads, people seem to know how to use it. I can only see it defined in boot.js, but it doesn't really tell me much...
Meteor uses connect npm module under the hood for various reasons, to serve static files, for example. __meteor_bootstrap__.app was the reference to connect app instance.
Before it was __meteor_bootstrap__.app but it changed couple of releases ago and became WebApp.connectHandlers object and is part of WebApp package.
WebApp is a standard package of Meteor, core package for building webapps. You don't usually need to add explicitly as it is a dependency of standard-app-packages.
Example of usage the connectHandlers is to inject connect middlewares in the same way as you would use any connect middleware (or some express middlewares, express is built on top of connect):
WebApp.connectHandlers
.use(connect.query())
.use(this._config.requestParser(bodyParser))
You can look at meteor-router Atmosphere package and take it as an example: https://github.com/tmeasday/meteor-router/blob/master/lib/router_server.js
More about connect: https://npmjs.org/package/connect
I have this seam project that a colleague built. I am trying to get it to build in Jboss dev Studio. He uses ant and builds manually. I got the project built in JBDS and deployed on the JBoss server. When i try to run the app, when it is time for the rules to fire, I get this error
Caused by: org.drools.RuntimeDroolsException: Unable to resolve class 'dne.nmst.ciscoconfig.model.ConfigParams_$$_javassist_seam_4'
The offending code is in the drools config file which includes 2 imports
package Config;
import dne.nmst.ciscoconfig.model.ConfigParams;
import dne.nmst.ciscoconfig.action.ConfigSelector;
Perhaps I need more detail here, I don't know what would be useful to post. I'm not even sure I know how to ask the question other than how do I fix this. Advice anyone?
Are you 100% sure the jar containing those imports is available at runtime, rather than just at compile time?