All Questions
Tagged with webpack ecmascript-6
1,120
questions
0
votes
1
answer
41
views
Confusion about javascript modules and webpack: The requested module ... does not provide an export named 'default'
I am trying to set up webpack in our javascript project and we want to write new javascript es6 classes, bundle them via webpack and then reuse the packages. I set up a simple example where i define a ...
0
votes
0
answers
187
views
How do I allow import.meta in nextjs _next/static/media directory?
I'm creating an app which uses wasm and other JavaScript files which I personally have not created. These files generate a file which is stored at this url: http://localhost:3000/_next/static/media/...
1
vote
0
answers
67
views
default export - is not a function
I'm currently working in a legacy project that's built using CommonJS. But because I needed to use react-pdf to create PDF files, I had to add .mjs files to my project.
This works fine on the dev ...
0
votes
1
answer
72
views
Webpack's ambiguous relationship with ES6 modules [closed]
Does Webpack support ES6 modules natively or not? This is a simple question but its answer seems to be more complicated than I initially thought.
On one hand, Webpack allows you to use ES6 syntax ...
0
votes
0
answers
17
views
"no lockfile entry" while importing remote JSON over http
I have a NextJS v12 app where I'm trying to import json file from my remote host, like this
const importJson = async () => {
// @ts-ignore
return await import("https://my-host.com/...
0
votes
0
answers
79
views
How can I use webpack5 and postcss7 with es6 import syntax
I have a website built using TS and SASS then compiled down to vanilla es6 JS "typw:module" and CSS. The compiled code then gets built into a compressed production ready version, using ...
0
votes
0
answers
495
views
Typescript: You may need an additional loader to handle the result of these loaders
I tried to integrate a library named -> YAML in my codebase.
But I am getting this error when I try to use the library:
ERROR in ./node_modules/yaml/browser/dist/nodes/YAMLSeq.js 93:14
Module parse ...
0
votes
1
answer
898
views
Unable to use MJS files on older web hosting platform
I am currently migrating a website from a new platform to a very old one. The older platform does not currently serve MJS files as the expected "application/javascript"/"application/x-...
0
votes
1
answer
209
views
Use webpack and babel to convert ES6 to ES5 file javascript but it doesn't work
I use webpack and babel to convert ES6 to ES5 file javascript but it doesn't work. File code javascript contains many functions.
This is file webpack.config.cjs:
module: {
rules: [
...
0
votes
0
answers
133
views
Importing node modules for browser usecase
Let me preface this with the following. I'm very new to everything you read about here.
I'm trying to use a JavaScript package manager - yarn.
Bundling the dependencies - Webpack seems to be the way.
...
1
vote
1
answer
2k
views
SyntaxError: Unexpected token 'export' while trying to import echarts in a svelte/svelt-kit project
I am trying to use Apache echarts inside a svelte/svelte-kit project for dynamic data visualization purpose.
While trying to import * as echarts from 'echarts/core'; it throws me the following error.
...
1
vote
0
answers
105
views
Why is my imported ES6 module not working?
I' building a WordPress plugin and I use Webpack to bundle my JavaScript code. Everything worked, until I wanted to implement some toast notifications with the jquery-toast-plugin.
The following code, ...
0
votes
1
answer
326
views
How to compress a React Project using gzip or brotli without using webpack?
I have a react project which doesn't use webpack to bundle its files. Its a docker application which uses nginx to serve static files on production server. All the resources available on internet use ...
1
vote
0
answers
165
views
How to import from a webpack bundle using my own node backend?
Given the 'webpack' bundle '/external_modules/seeso/dist/seeso.js' from the 'seeso' package and a node backend I wrote that sends files according to their path:
import { fileURLToPath } from 'url';
...
0
votes
1
answer
65
views
Missing Script generated by Webpack(development) on first page load
the first time i load the login page the login.js script doesn't load , only the shared.js bundle loads (which has bootstrap js/css and toastr css), if i refresh the page everything loads without ...