I’m importing my JavaScript “module” using the “dynamic import()” call: and, this is the script.js file: By running it, Google Chrome complains that the “object is not extensible” while adding whatever: So, what’s wrong and how to work around the issue? Answer m…
Tag: module
In Angular 14, how do I include a child component in a standalone component?
I’m using Angular 14. I have a standalone component in which I want to include a child component from another module. The standalone component looks like and its service file is The child component is in another module — MyModule. The my.module.ts file looks like But my parent’s HTML is givi…
Why export default doesn’t work in this simple code?
Why when I use export default on index.js module it says: export ‘appReducers’ (imported as ‘appReducers’) was not found in ‘./reducers/index’ (possible exports: default), but when I change it to module.exports the error go away, why is that? At redux.js in index.js in app.…
Import JSON inside NPM Module
I made an npm module, this module export a function that load a json file and then export the result ( a little bit simplified ) The probleme is when I import this module inside another project I have this error : I looks like when I import my module, it try to read the json inside the current directory
JS: import an array module into main script and not HTML
I’m new to JavaScript. I’ve looked for an answer to my problem, but can’t figure this out. Likewise, I have an array of different options (for a text adventure game) that I want to import into the main JS script. The issue is that I am calling different options from the array in the main script, and it’s not …
Put module into component, angular
I need put a mdbModal into a component, but the component does’nt have a module.ts archive, when try this movement I get: I dont have examples in my collective project, What is the way of can import a module inside a component? I’m relatively new on angular. This is my parent module I dont have pr…
Import module in React several times. Is the code executed once vs executed multiple times
Everything started from the need to do a configuration in a function call and figure out what happened if imported in more than one file. I have this function Two cases. Import the function directly and display it in several places. Different values are displayed. First case Second case. In this second case, …
How can I use import and export with this simple code?
I want to use the doAlert function in the index.js file. Now, how do I use import and export in this situation? Answer More info on JS modules: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
How to call function described in the module by clicking on button?
I’m working on creating pizzeria site. I decided to create id as SPA with fixed navigation. To simplificy my code I created it in modules and now I have a big problem with them. How I can link module function to button in headers, because it throws an error. Here I posted my code to demonstate the error…
How to make webpack not use the window object when bundling?
I’m making a React component library to abstract out some components I use in multiple projects. Some projects are made with CRA, some with Gatsby, some might be something else, etc. I used the Neutrino.js framework/toolchain as it was linked on the React docs site, but the issue I ran into is that by d…