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

ERROR - Module not found - Can't resolve './${previewSrc}' #63091

Closed
nicitaacom opened this issue Mar 9, 2024 · 9 comments
Closed

ERROR - Module not found - Can't resolve './${previewSrc}' #63091

nicitaacom opened this issue Mar 9, 2024 · 9 comments
Labels
bug Issue was opened via the bug report template. Image (next/image) Related to Next.js Image Optimization. locked

Comments

@nicitaacom
Copy link

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/mvp-cannot-resolve-previewsrc-8kfn23

To Reproduce

  1. Open codeasndbox
  2. See this error
    image

Current vs. Expected behavior

I expect no error
I got error

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 14.1.0
  eslint-config-next: 14.1.0
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Image optimization (next/image, next/legacy/image)

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

I found no related issues to this

This is not related to this issues - admins please don't close after 10 seconds on looking on this issue:
https://stackoverflow.com/questions/65125891/cant-resolve-images-img-2-jpg-in-e-react-react-demo-src
#17639

In my case I have issue related to some previewSrc in globals.css

I in fact I don't changed default globals.css

@nicitaacom nicitaacom added the bug Issue was opened via the bug report template. label Mar 9, 2024
@github-actions github-actions bot added the Image (next/image) Related to Next.js Image Optimization. label Mar 9, 2024
@nicitaacom
Copy link
Author

nicitaacom commented Mar 9, 2024

image

Also its fake

image

It don't let you to insert YouTube video - please update docs

There should be

 <iframe
        width="560"
        height="315"
        src="https://www.youtube.com/embed/jfKfPfyJRdk?si=aUjXBlmyUhSPy27u"
        title="YouTube video player"
        frameBorder="0"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
        allowFullScreen></iframe>

@JesseKoldewijn
Copy link
Contributor

image

Also its fake

image

It don't let you to insert YouTube video - please update docs

There should be


 <iframe

        width="560"

        height="315"

        src="https://www.youtube.com/embed/jfKfPfyJRdk?si=aUjXBlmyUhSPy27u"

        title="YouTube video player"

        frameBorder="0"

        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"

        allowFullScreen></iframe>

This comment is unrelated to the provided issue.

@JesseKoldewijn
Copy link
Contributor

And with regards to the import. You might want to take a look at the following docs. Since this isn't a Next.js issue in this case.

https://webpack.js.org/api/module-methods/#import-

@nicitaacom
Copy link
Author

I guess this code in VideoOverlay.tsx cause issue (you may delete other stuff to make sure in that)

 <div
        className={`preview bg-[url('${previewSrc}')] bg-no-repeat bg-cover
				absolute inset-0 z-[1]`}
        onClick={() => {
          playPauseVideo()
        }}></div>

I updated codesandbox

Also I think its because of this code - any workaround?

@JesseKoldewijn
Copy link
Contributor

JesseKoldewijn commented Apr 28, 2024

I guess this code in VideoOverlay.tsx cause issue (you may delete other stuff to make sure in that)

 <div
        className={`preview bg-[url('${previewSrc}')] bg-no-repeat bg-cover
				absolute inset-0 z-[1]`}
        onClick={() => {
          playPauseVideo()
        }}></div>

I updated codesandbox

Also I think its because of this code - any workaround?

The provided snippet isn't intended to work, refer to the TailwindCSS docs using the link below:
https://tailwindcss.com/docs/content-configuration#dynamic-class-names

@nicitaacom
Copy link
Author

I guess this code in VideoOverlay.tsx cause issue (you may delete other stuff to make sure in that)

 <div
        className={`preview bg-[url('${previewSrc}')] bg-no-repeat bg-cover
				absolute inset-0 z-[1]`}
        onClick={() => {
          playPauseVideo()
        }}></div>

I updated codesandbox
Also I think its because of this code - any workaround?

The provided snippet isn't intended to work, refer to the TailwindCSS docs using the link below: https://tailwindcss.com/docs/content-configuration#dynamic-class-names

I see this

image

And how do you want me to write it?

@JesseKoldewijn
Copy link
Contributor

I guess this code in VideoOverlay.tsx cause issue (you may delete other stuff to make sure in that)

    className={`preview bg-[url('${previewSrc}')] bg-no-repeat bg-cover
  		absolute inset-0 z-[1]`}
    onClick={() => {
      playPauseVideo()
    }}></div>

I updated codesandbox

Also I think its because of this code - any workaround?

The provided snippet isn't intended to work, refer to the TailwindCSS docs using the link below: https://tailwindcss.com/docs/content-configuration#dynamic-class-names

I see this

image

And how do you want me to write it?

You could use the styles prop for that instead of tailwind. In all cases, this is unrelated to Next.js specifically. So if you could close this issue, that would be great 👍

Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. Image (next/image) Related to Next.js Image Optimization. locked
Projects
None yet
Development

No branches or pull requests

2 participants