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

[Bug]: Module not found: Error: Can't resolve '../../icons/view/16' in '/opt/data/npm_test/node_modules/@carbon/web-components/es/components/text-input' #17813

Closed
2 tasks done
niceblex33 opened this issue Oct 20, 2024 · 0 comments · Fixed by #17818
Assignees
Labels

Comments

@niceblex33
Copy link

Package

@carbon/web-components

Browser

No response

Package version

2.15.0

React version

No response

Description

Hi. Cannot build project with web-components v2.15.0, build fails with the error

Module not found: Error: Can't resolve '../../icons/warning--filled/16' in '/opt/data/npm_test/node_modules/@carbon/web-components/es/components/checkbox'
Did you mean '16.js'?
BREAKING CHANGE: The request '../../icons/warning--filled/16' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./node_modules/@carbon/web-components/es/components/data-table/table-row.js 17:0-39
 @ ./node_modules/@carbon/web-components/es/components/data-table/index.js 20:0-24
 @ ./src/index.js 1:0-57
root:/opt/data/npm_test# webpack -v

  System:
    OS: Linux 5.15 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (2) x64 Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
    Memory: 1.52 GB / 3.82 GB
  Binaries:
    Node: 18.19.0 - /usr/bin/node
    npm: 9.2.0 - /usr/bin/npm
  Packages:
    babel-loader: ^9.2.1 => 9.2.1 
    webpack: ^5.95.0 => 5.95.0 
    webpack-cli: ^5.1.4 => 5.1.4 
root:/opt/data/npm_test# cat package.json 
{
  "dependencies": {
    "@babel/core": "^7.25.8",
    "@babel/preset-env": "^7.25.8",
    "@carbon/icons": "^11.51.0",
    "@carbon/styles": "^1.67.0",
    "@carbon/web-components": "^2.15.0",
    "babel-loader": "^9.2.1",
    "webpack": "^5.95.0",
    "webpack-cli": "^5.1.4"
  }
}
root:/opt/data/npm_test# cat webpack.config.js 
const path = require('path');

module.exports = {
  entry: './src/index.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist'),
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
        },
      },
    ],
  },
  resolve: {
    extensions: ['.js', '.mjs'],
    fullySpecified: false
  },
  mode: 'production',
};
root:/opt/data/npm_test# cat src/index.js 
import '@carbon/web-components/es/components/data-table';

Reproduction/example

https://stackblitz.com/edit/webpack-webpack-js-org-hdwcy4

Steps to reproduce

  1. Copy packages.json
  2. npm install
  3. copy webpack.config.js
  4. copy src/index.js
  5. run npx webpack

Suggested Severity

Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

@tay1orjones tay1orjones moved this to ⏱ Backlog in Design System Oct 21, 2024
@annawen1 annawen1 self-assigned this Oct 21, 2024
@annawen1 annawen1 moved this from ⏱ Backlog to 🏗 In Progress in Design System Oct 21, 2024
@annawen1 annawen1 moved this from 🏗 In Progress to 🚦 In Review in Design System Oct 21, 2024
@github-project-automation github-project-automation bot moved this from 🚦 In Review to ✅ Done in Design System Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants