Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESM] Webpack 5 - NodeJs Server #30525

Open
Tracked by #43938
joacub opened this issue Jan 7, 2022 · 2 comments
Open
Tracked by #43938

[ESM] Webpack 5 - NodeJs Server #30525

joacub opened this issue Jan 7, 2022 · 2 comments
Labels
breaking change enhancement This is not a bug, nor a new feature scope: code-infra Specific to the core-infra product

Comments

@joacub
Copy link

joacub commented Jan 7, 2022

Current behavior 😯

ESM are not usable in server side, after node 12 esm is enabled and when we want to use esm is imposible since the packages.json does not have type: module or the files are not properly named with .mjs ext.

when using import Accordion from '@mui/material/Accordion';

this throw an error since is getting the index.js in that folder instead the main in package wich is the commonjs file.

Expected behavior 🤔

expected imported either commonjs file correctly or mark the package.json with type: module as per nodes specs.

Steps to reproduce 🕹

Steps:

  1. import any material module
  2. mark you own package with type:module as well
  3. execute node supporting modules

Context 🔦

Server Side

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: macOS 12.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 2.95 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.0.1 - ~/.nvm/versions/node/v17.0.1/bin/node
    npm: 8.1.3 - ~/.nvm/versions/node/v17.0.1/bin/npm
  Managers:
    Homebrew: 3.3.3 - /opt/homebrew/bin/brew
    pip3: 21.2.4 - /opt/homebrew/bin/pip3
    RubyGems: 3.0.3.1 - /usr/bin/gem
  Utilities:
    Make: 3.81 - /usr/bin/make
    GCC: 4.2.1 - /usr/bin/gcc
    Git: 2.32.0 - /usr/bin/git
    Clang: 13.0.0 - /usr/bin/clang
    FFmpeg: 4.4.1 - /opt/homebrew/bin/ffmpeg
  Servers:
    Apache: 2.4.51 - /usr/sbin/apachectl
  Virtualization:
    Docker: 20.10.10 - /usr/local/bin/docker
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
  IDEs:
    Nano: 2.0.6 - /usr/bin/nano
    Vim: 8.2 - /usr/bin/vim
    Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
  Languages:
    Bash: 3.2.57 - /bin/bash
    Perl: 5.30.3 - /usr/bin/perl
    Python: 2.7.18 - /usr/bin/python
    Python3: 3.9.7 - /opt/homebrew/bin/python3
    Ruby: 2.6.8 - /usr/bin/ruby
  Databases:
    MySQL: 10.6.4 (MariaDB) - /opt/homebrew/bin/mysql
    SQLite: 3.36.0 - /usr/bin/sqlite3
  Browsers:
    Chrome: 96.0.4664.110
    Safari: 15.2
@joacub joacub added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 7, 2022
@siriwatknp
Copy link
Member

There is an afford to support ESM. #30510

@siriwatknp siriwatknp added new feature New feature or request and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 7, 2022
@joacub
Copy link
Author

joacub commented Jan 7, 2022

Nice, is there any deadline for this ?

@oliviertassinari oliviertassinari changed the title ESM - Webpack 5 - NodeJs Server [ESM] Webpack 5 - NodeJs Server Aug 12, 2023
@oliviertassinari oliviertassinari added breaking change enhancement This is not a bug, nor a new feature scope: code-infra Specific to the core-infra product and removed new feature New feature or request labels Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change enhancement This is not a bug, nor a new feature scope: code-infra Specific to the core-infra product
Projects
None yet
Development

No branches or pull requests

3 participants