Skip to main content

Questions tagged [es6-module-loader]

ES6 Module Loader Polyfill dynamically loads ES6 modules in browsers and NodeJS with support for loading existing and custom module formats through loader hooks.

es6-module-loader
0 votes
1 answer
149 views

Cannot use import statement outside a module (Vanilla JS) [duplicate]

I'm getting Cannot use import statement outside a module(Vanilla Javascript) while testing a simple demo app locally using nano server. data.js const data = { "type": "Feature",...
user994165's user avatar
  • 9,344
1 vote
1 answer
498 views

Using multiple loaders in Node

Loaders in Node can be used to hook into the module loading process, intercepting import or require calls. This works fine, but sometimes you might want to use multiple loaders. For instance, you are ...
oligofren's user avatar
  • 22.2k
0 votes
1 answer
355 views

Are circular references ok in .d.ts files?

When creating typescript declarations for a javascript library, is it ok to have circular imports in .d.ts files? E.g.: file a.d.ts import { B } from "./b"; export class A { ... } ... file ...
Yevgeniy P's user avatar
  • 1,542
0 votes
1 answer
201 views

What does @ mean while importing libraries in JavaScript? import '@library-name' [duplicate]

For example: import { createDrawerNavigator } from '@react-navigation/drawer'; What is the significance of the '@'? I tried looking it up but the answers explained its usage as a pointer to the root ...
can-ishk's user avatar
0 votes
1 answer
887 views

Cannot use import statement outside a module CLIENT-SIDE

At client-side, I want to import only a specific part of my Javascript module. But I wanna do that on demand, like when a user performs an action that needs that specific part of the module. I was ...
Pedro Rabbi's user avatar
0 votes
1 answer
42 views

Loader reference to handle the react error

When i try implementing the following code const handleClick = (click) => { let result = {}; const output = Object.keys(value)?.map((ele) => { if (ele === click) result[ele] = true; ...
Shilpa Shivaprakash's user avatar
2 votes
1 answer
2k views

ES6 module fails on Safari mobile (iOS14.6)

I'm experimenting with Javascript modules both via desktop (latest Chrome) and mobile (Safari with iOS 14.6) and my code works perfectly on the desktop (standard browser or mobile emulation mode) but ...
AlexN's user avatar
  • 51
0 votes
1 answer
4k views

Javascript you may need an additional loader

We are working on the following module js(javascript only), which allows to generate random colors. Link: Github When we try to install the module on an example on codesandbox, we have no problem. But ...
Paul's user avatar
  • 4,302
0 votes
1 answer
483 views

Calling a method inside an IIFE exported method

i have a script which i want to expose a function using JS Modules this script is compiled using esbuild. pre-transpiled file (index.mjs) const NakamaWrapper = require("./nakama").default ...
Zentyk's user avatar
  • 67
2 votes
0 answers
739 views

dynamic import from literal string instead of path in ES6

is it possible to import from a js string? import(`alert("Hello")`); which gives us more control over http fetching, like loading from protected url with access token.
PeiSong's user avatar
  • 921
1 vote
0 answers
178 views

TypeScript Clientside usage

I am in the process of migrating my project from JavaScript to TypeScript, so far everything went according to plan, but now I encountered a problem. On the server side the TypeScript files are seen ...
XIIII's user avatar
  • 21
0 votes
0 answers
186 views

Declaring functions using a require statement inside a Node.js class

I am willing to define class methods by using require statements. As follows: class A { constructor () {} static functionA = require('./someFileA'); static functionB = require('./someFileB'); ...
Leonardo Kuffo's user avatar
1 vote
0 answers
139 views

How do I import @material/mwc-button without precompiling?

I have the following code... <html> <head></head> <body> <mwc-button label="Hello World"></mwc-button> <script src="https://unpkg.com/...
Jackie's user avatar
  • 23.1k
5 votes
1 answer
2k views

Is circular type reference a bad thing to do In TypeScript?

I encountered below code snippets which contain a cyclic importing dependency on type reference. // Foo.ts import { Bar } from './Bar'; export interface Foo { isBarOK: (bar: Bar) => boolean; } //...
Ruifeng Ma's user avatar
  • 2,607
4 votes
1 answer
7k views

Jest test suite failed to run because of "TypeError: Cannot read property 'xxx' of undefined"

I am trying to reorganize the import/export statements of my TypeScript React project to make them shorter and cleaner, basically by the approach of defining an index.ts file in each feature specific ...
Ruifeng Ma's user avatar
  • 2,607

15 30 50 per page
1
2 3 4 5
20