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

Use file-loader to modify the image path error after packaging #50727

Closed
1 task
dongcer opened this issue Jun 3, 2023 · 2 comments
Closed
1 task

Use file-loader to modify the image path error after packaging #50727

dongcer opened this issue Jun 3, 2023 · 2 comments
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@dongcer
Copy link

dongcer commented Jun 3, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: win32
      Arch: x64
      Version: Windows 10 Home China
    Binaries:
      Node: 14.17.6
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant packages:
      next: 12.2.4
      eslint-config-next: 12.2.2
      react: 18.2.0
      react-dom: 18.2.0

warn  - Latest canary version not detected, detected: "12.2.4", newest: "13.4.5-canary.4".
        Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

no

To Reproduce

//next.config.js
webpack: (config, options) => {

config.module.rules.push(
  {
    test: /\.(png|jpe?g|gif|svg)$/i,
    use: [
      {
        loader: 'file-loader',
        options: {
          name: 'static/medssssia/[name].[hash].[ext]',
          publicPath: '/scasca',
          outputPath: 'static/images',
        },
      },
    ],
  }
);

return config;

}

//index.tsx

import Image from "next/image";
import logo from "@/assets/arrowNone.png"

const Home = (props: any) => {

return (


//

<Image  height={90} width={120} src={logo} alt=""  ></Image>
) };

export default Home;

Describe the Bug

image
An error is reported when building

Expected Behavior

Whether I introduce a local Image in the next/Image, IMG Tag, or Sass, I want to be able to change the path of the packaged Image

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@dongcer dongcer added the bug Issue was opened via the bug report template. label Jun 3, 2023
@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Feb 16, 2025
@nextjs-bot
Copy link
Collaborator

This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

@nextjs-bot nextjs-bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants