callstack / repack

A Webpack-based toolkit to build your React Native application with full support of Webpack ecosystem.
https://re-pack.dev
MIT License
1.48k stars 110 forks source link

Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (1:0) #696

Closed snehaJain8 closed 3 months ago

snehaJain8 commented 3 months ago

Environment

React Native Version: 0.72.14 Re.Pack Version: 4.2.0 Node Version: 18.18.0 Webpack Version: ^5.93.0 "babel-loader": "^9.1.3", "babel-plugin-module-resolver": "^5.0.2",

Description

I am trying to integrate Re.Pack and Module Federation into an existing React Native project. However, I am facing the following issue: Error in "./node_modules/axios/index.js": Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (1:0) File was processed with these loaders:

const dirname = Repack.getDirname(import.meta.url); const { resolve } = createRequire(import.meta.url);

/**

/**

Here is my webpack.config.mjs file:

Reproducible Demo