Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Failed to compile - Error: Can't resolve '...' .bg- #8503

Answered by adamwathan
facos86 asked this question in Help
Discussion options

What version of Tailwind CSS are you using?
"react": "^17.0.2",
"cross-env": "7.0.3",
"cssnano": "5.1.10",
"postcss-cli": "9.1.0",
"react-error-overlay": "^6.0.9",
"release-it": "13.6.4",
"tailwindcss": "^3.0.24",
"autoprefixer": "^10.4.7"

Describe your issue

Hi,
I am encountering a problem with the latest version of tailwindcss.
It generates "background-image: url('...');" in tailwind.output.css, the three dots '...' cannot be resolved.
Screenshot 2022年06月02日 at 18 29 37
Screenshot 2022年06月02日 at 18 31 39

Is there any configuration issues or is there a bug with my current stup ?

You must be logged in to vote

Hey! Those look like classes being generated based on Tailwind's test suite, which makes me think your content configuration is watching node_modules when it shouldn't be.

https://tailwindcss.com/docs/content-configuration#pattern-recommendations

Replies: 1 comment 9 replies

Comment options

Hey! Those look like classes being generated based on Tailwind's test suite, which makes me think your content configuration is watching node_modules when it shouldn't be.

https://tailwindcss.com/docs/content-configuration#pattern-recommendations

You must be logged in to vote
9 replies
Comment options

Were you able to solve this?

Comment options

Comment options

I am getting this error:

Module not found: Can't resolve './${selectedImagePath}'
Import trace for requested module:
./styles/globals.css
./pages/_app.js

because I used variable inside the tailwind class as follows

bg-[url('${selectedImagePath}')]

Now i am unable to reset my output file globals.css and the error persists.

delete the

I am getting this error:

Module not found: Can't resolve './${selectedImagePath}'
Import trace for requested module:
./styles/globals.css
./pages/_app.js

because I used variable inside the tailwind class as follows

bg-[url('${selectedImagePath}')]

Now i am unable to reset my output file globals.css and the error persists.

Delete the bg variable save and restart the server, then put a working bg variable in, then save and refresh the server, it will reset your global css. I have no clue how to make it display properly sadly.

Comment options

@boblamceo i found an old yarn.lock file which made it run. I was unable to resolve the above error which I get when generating new yarn.lock file and then implementing the above solution.

Comment options

@tomBoyd9002 How were you able to resolve your issue?

Answer selected by facos86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
Converted from issue

This discussion was converted from issue #8502 on June 02, 2022 16:32.

AltStyle によって変換されたページ (->オリジナル) /