Skip to content
New issue

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

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

Already on GitHub? # to your account

Error: Package exports for '.\colorette' do not define a valid '.' target #49

Closed
abhichatbot opened this issue Jul 12, 2020 · 20 comments
Closed

Comments

@abhichatbot
Copy link

Installed with material-ui but not able to compile due to this.

@jorgebucaran
Copy link
Owner

@abhichatbot Could you create a repo so I can reproduce this? Also, make sure this is not a dupe of #48.

@jorgebucaran
Copy link
Owner

Closing due to lack of activity. And this is most likely a duple of #48. 👋

@iannngit
Copy link

iannngit commented Aug 20, 2020

I just got this error in Travis.

Here's my package.json

"dependencies": {
    "core-js": "^3.6.5",
    "firebase": "^7.18.0",
    "vue": "^2.6.11",
    "vue-router": "^3.2.0",
    "vuex": "^3.4.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-plugin-vuex": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "sass": "^1.26.5",
    "sass-loader": "^8.0.2",
    "vue-template-compiler": "^2.6.11"
  },

Here's main part of my Travis yml.

...
language: node_js
node_js:
  - "13.0"
install:
  - npm install
  - npm run build
...

Some error logs in Travis

$ node --version
v13.0.1
$ npm --version
6.12.0
$ nvm --version
0.35.3
before_install
22.92s$ npm install -g firebase-tools
install.1
30.76s$ npm install
0.98s$ npm run build
> ___@0.1.0 build /home/travis/build/___/___
> vue-cli-service build
-  Building for production...
 ERROR  Error: Package exports for '/home/travis/build/___/___/node_modules/colorette' do not define a valid '.' target

@iannngit
Copy link

iannngit commented Aug 20, 2020

Changed to Node v12 and it's all good now. 😅

node_js:
  - "12"

Actually, maybe the error occurs with 13.0.1 only.

@jorgebucaran
Copy link
Owner

Yes, that's correct. You may also upgrade to >=14.

@isochronous
Copy link

This is happening for me on node version 12.4.1

@jorgebucaran
Copy link
Owner

@isochronous Are you sure? That doesn't seem to be a valid Node version. https://nodejs.org/dist/v12.4.1

@isochronous
Copy link

My bad, missed a 1, it's 12.14.1

@isochronous
Copy link

For the time being I've just reverted to an earlier version of the package requiring colorette, which in turn requires a version of colorette that doesn't exhibit the same issue.

@jorgebucaran
Copy link
Owner

Just tested it with 12.14.1 and it's working. This must be an issue with that package or your configuration. What package is that?

@isochronous
Copy link

As far as I can tell, it's autoprefixer. It's hard to tell for sure because the only place the error occurs is on a remote build agent that doesn't provide very detailed logs.

@jorgebucaran
Copy link
Owner

@isochronous Make sure you're not in fact using Node 13. It does happen: postcss/autoprefixer#1352, postcss/autoprefixer#1353 (comment)

@isochronous
Copy link

I mean, I'm definitely not according to nvm

@jorgebucaran
Copy link
Owner

jorgebucaran commented Aug 21, 2020

@isochronous Did you try?

"I set nvm use 14.8.0, deleted the root node_modules dir, and ran npm install again. Everything is fine now."

I speculate the issue is in your project or your environment, and not autoprefixer. I've run out of ideas—sorry! 😅

@isochronous
Copy link

Yeah, I'm pretty sure there's something screwed up in the environment as well - last couple of builds it's told me it can't find autoprefixer on npm -_-

Thanks for trying though :)

@isochronous
Copy link

So, just to update, we had the same exact issue happen on node 12.14.1 (verified by using console.log(process.version) on three different build agents. However, I updated to the latest LTS (12.18.3, I believe) and the problem went away. I have no idea what the issue was, but it was remarkably consistent across those three machines.

@jorgebucaran
Copy link
Owner

jorgebucaran commented Aug 25, 2020

@isochronous By creating an empty project using 12.14.1, importing colorette and trying something like red("hello"), you can rule out colorette is the issue, assuming that works. Worked for me.

@isochronous
Copy link

The problem occurs on install, so I don't think that would work. I'm seriously confused as to WTF is going on here. Like I said though, it works on a different version of node, so it's NBD, just thought you might be interested to hear the resolution.

@jorgebucaran
Copy link
Owner

Definitely. Thank you for sharing it!

@AngeloVK
Copy link

Had the same issue today with version 13.0.1. After updating node to 14.9 this was resolved

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants