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

running parcel fails for error @parcel/optimizer-cssnano: Could not resolve module "dot-prop" from "postcss-selector-parser" #6731

Closed
GuyKh opened this issue Aug 17, 2021 · 11 comments
Labels
Stale Inactive issues

Comments

@GuyKh
Copy link

GuyKh commented Aug 17, 2021

🐛 bug report

running parcel fails for error @parcel/optimizer-cssnano: Could not resolve module "dot-prop" from ".../postcss-selector-parser/dist/parser.js"

🎛 Configuration (.babelrc, package.json, cli command)

{
...
...
  "main": "dist/index.js",
  "browser": "dist/public/js/main.js",
  "source": "build src/public/js/main.ts",
  "targets": {
    "browser": {
      "includeNodeModules": true
    }
  },
...
...
  "scripts":  {
  ... 
   "parcel": "parcel build src/public/js/main.ts --target browser --no-scope-hoist",
 ...
 }
}

🤔 Expected Behavior

Build should complete and work

😯 Current Behavior

Full error:

> parcel build src/public/js/main.ts --target browser --no-scope-hoist

🚨 Build failed.
@parcel/optimizer-cssnano: Could not resolve module "dot-prop" from "/Users/guyk/workspace/moneyball/mb_queue/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js"
Error: Could not resolve module "dot-prop" from "/Users/guyk/workspace/moneyball/mb_queue/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js"
    at NodeResolverSync.resolve (/Users/guyk/workspace/moneyball/mb_queue/node_modules/@parcel/package-manager/lib/NodeResolverSync.js:44:15)
    at NodePackageManager.resolveSync (/Users/guyk/workspace/moneyball/mb_queue/node_modules/@parcel/package-manager/lib/NodePackageManager.js:354:36)
    at NodePackageManager.requireSync (/Users/guyk/workspace/moneyball/mb_queue/node_modules/@parcel/package-manager/lib/NodePackageManager.js:173:14)
    at Module.m.require (/Users/guyk/workspace/moneyball/mb_queue/node_modules/@parcel/package-manager/lib/NodePackageManager.js:194:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/Users/guyk/workspace/moneyball/mb_queue/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:7:16)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at NodePackageManager.load (/Users/guyk/workspace/moneyball/mb_queue/node_modules/@parcel/package-manager/lib/NodePackageManager.js:208:9)
ERROR: "parcel" exited with 1.
ERROR: "build" exited with 1.
[nodemon] app crashed - waiting for file changes before starting...

💁 Possible Solution

🔦 Context

💻 Code Sample

🌍 Your Environment

Software Version(s)
Parcel 2.0.0-rc0
Node v16.6.2
npm/Yarn npm 7.20.6
Operating System MacOS 11.5.1
@GuyKh
Copy link
Author

GuyKh commented Aug 17, 2021

I had a dependency of "postcss": "^8.2.10"

When I removed this - I'm getting the following (different) error on build:

@parcel/core: node_modules/vue/dist/vue.runtime.esm-bundler.js does not export 'createElementBlock'

  /Users/guyk/workspace/moneyball/mb_queue/src/public/js/env-card-title.vue:1:115
  > 1 | <template>
  >   |           ^
    2 |   <div>
    3 |     <span class="card-title">

@mischnic
Copy link
Member

"main": "dist/index.js",
"browser": "dist/public/js/main.js",

Are you building a webapp? If yes, then you should choose different names for "main" and "browser" (and maybe remove one of the entirely)

@GuyKh
Copy link
Author

GuyKh commented Aug 17, 2021

@mischnic this is an SSR, it has a express backend, and a vue frontend (under js folder)
I'll give it a try though

EDIT:
didn't help :(

@mischnic
Copy link
Member

mischnic commented Aug 17, 2021

Please provide a code sample that reproduces the error(s).

@GuyKh
Copy link
Author

GuyKh commented Aug 17, 2021

Actually, removing the postCss dependency and rolling back to Parcel 2.0.0-beta2 seems to have solved the issue

@GuyKh GuyKh closed this as completed Aug 17, 2021
@GuyKh
Copy link
Author

GuyKh commented Oct 20, 2021

With Parcel 2.0.0 this issue returned.
Reopening the ticket :(

 Build failed.

@parcel/core: node_modules/vue/dist/vue.runtime.esm-bundler.js does not export 'createElementVNode'

  /Users/guyk/workspace/moneyball/mb_queue/src/public/js/env-card.vue:1:78
  > 1 | <template>
  >   |           ^
    2 |   <div class="row">
    3 |     <div class="col s12">

Need to mention that this works great in 2.0.0-beta2 - and upon upgrade to 2.0.0 it started happening again
Moreover - I tried to find the one dependency that caused it -
It started happening when I updated parcel and @parcel/transformer-vue to 2.0.0

@GuyKh GuyKh reopened this Oct 20, 2021
@mischnic
Copy link
Member

mischnic commented Oct 20, 2021

Please provide a complete code sample so that we can reproduce this.

@GuyKh
Copy link
Author

GuyKh commented Oct 20, 2021

for example, the following Vue file fails to copmile:

<template>
  <h3>Title</h3>
</template>

@mischnic
Copy link
Member

I think this is because you are using Vue 2 in your project, and not Vue 3? #6153

@GuyKh
Copy link
Author

GuyKh commented Oct 22, 2021

I think this is because you are using Vue 2 in your project, and not Vue 3? #6153

Nope. Latest vue 3

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Jun 20, 2022
@github-actions github-actions bot closed this as completed Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Inactive issues
Projects
None yet
Development

No branches or pull requests

2 participants