Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

490
Views
No se encontró la exportación 'predeterminada' cuando intento importar mi biblioteca de paquetes web

Este es mi código fuente ./source/client/main.jsx .

 export default { test: () => console.log('Flow') };

Y este es mi webpack.config.cjs .

 const path = require('path'); const webpack = require('webpack'); const packageJSON = require('./package.json'); module.exports = (env, argv) => { return { mode: 'development', entry: './source/client/main.jsx', // entry: './main.js', output: { path: path.join(__dirname, 'release'), filename: 'main.js', library: { name: packageJSON.name, type: 'umd' } }, devtool: 'source-map', module: { rules: [ { test: /\.jsx?$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: [ '@babel/preset-env', '@babel/preset-react' ], plugins: [ '@babel/plugin-transform-runtime' ] } } } ] } }; };

Mi package.json contiene una lista de dependencias y tanto el main como el module apuntan al producto del paquete web.

 "main": "./release/main.js", "module": "./release/main.js",

Sin embargo, cuando intento importar mi módulo en otro proyecto de paquete web, aparece el error predeterminado No se encontró.

 import Test from 'test';
 export 'default' (imported as 'Test') was not found in 'test' (module has no exports)

¿Estoy construyendo mal el módulo?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!