question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on CLI Build: No transformers found for [file] with pipeline: 'types'.

See original GitHub issue

šŸ› bug report

I’m trying to upgrade to parcel 2.0.0 and made the appropriate changes for my setup (add type=ā€œmoduleā€, change ā€œā€“out-dirā€ to ā€œā€“dist-dirā€) but when trying to run my start command I get the following error in the console:

 @parcel/core: No transformers found for example/raycast.html with pipeline: 'types'.

The error on it’s own doesn’t make sense to me so it’s unclear what I can do to fix it. I found this similar issue but the provided solution offers no explanation as to what’s going on and it isn’t viable for packages to remove the ā€œmainā€, ā€œmoduleā€ and ā€œtypesā€ fields from the package.json.

šŸŽ› Configuration (.babelrc, package.json, cli command)

babel.config.json

package.json

cli command:

parcel watch ./example/raycast.html --dist-dir ./example/dev-bundle/ --public-url . --no-cache

šŸ¤” Expected Behavior

That the parcel command work and build the html files into the provided directory the way it did before 2.0.0.

😯 Current Behavior

An error is thrown, files are not built.

šŸ’ Possible Solution

–

šŸ”¦ Context

I cannot upgrade to v2.0.0 and take advantage of the new features including better WebWorker support, more correct script module tag interpretation.

šŸ’» Code Sample

–

šŸŒ Your Environment

Software Version(s)
Parcel v2.0.0
Node v16.3.0
npm/Yarn v6.14.9
Operating System Windows 10

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
gkjohnsoncommented, Nov 3, 2021

Thanks for the suggestions @mischnic. I’ve gotten it working but I needed to work around a few things, first. I chose to create an empty package.json in my ā€œexampleā€ folder and cd’d into the example folder before building so I didn’t have to clutter my primary package.json these (imo) confusing ā€œtargetsā€ field and mess with the side effects flag. I also moved my babel.config.json file used for my jest tests into the ./test folder so parcel would stop complaining about it.

If I can offer some feedback on the process here I think Parcel is trying a little too hard to be smart here. If I’m explicitly specifying entry points in my command line arguments is there a reason for it to be looking at my package.json for files? It doesn’t seem like it should be, at least. Likewise I’d like to be able to specify the babel config that’s used in the cli (or to ignore any that are found) so I have more control.

All I really want from a bundler is to be able to explicitly say ā€œbundle these files with this configā€. This approach of trying to auto build from the context of a users package.json is interesting but leaves a lot of guess work as to what’s being looked for when things don’t work out. It clearly has it’s place but perhaps there’s room to add some arguments to say ā€œjust pay attention to what I tell you aboutā€?

Thank you again!

0reactions
sajanv88commented, Jul 25, 2022

Hello, I had this same issue and I followed parcel documentation targets then I defined targets in my package.json file, something like this, below. It worked!

"types": "dist/types.d.ts",
  "targets": {
    "demo": {
      "source": "src/docz/index.html",
      "distDir": "./docz",
      "isLibrary": false
    },
    "cjs": {
      "source": "src/lib/index.ts",
      "isLibrary": true
    },
    "esm": {
      "source": "src/lib/index.ts",
      "isLibrary": true
    },
    "types": {
      "source": "src/lib/index.ts"
    }
  },
"scripts": {
    "start": "parcel src/docz/index.html --port 3001 --dist-dir docz/dist",
    "build:demo": "parcel build --target demo --public-url /",
    "build": "npm run build:lib && npm run build:scss && npm run build:demo && npm run deploy",
    "build:lib": "npm run build:cjs && npm run build:esm && npm run build:types",
    "build:cjs": "parcel build --target cjs",
    "build:esm": "parcel build --target esm",
    "build:types": "parcel build --target types",
}

If someone fixed differently, please post it here. It would be really helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

parcel/core: No transformers found for .exr file - Stack Overflow
This question is very similar to my problem. I created a .parcelrc file with the code: { "extends": "@parcel/config-default",Ā ...
Read more >
What to do when you get an error - Hugging Face Course
In this section we'll look at some common errors that can occur when you're trying to generate predictions from your freshly tuned Transformer...
Read more >
Troubleshooting Amazon SageMaker Model Building Pipelines
Information about common errors and how to resolve them when using Amazon SageMaker Model Building Pipelines.
Read more >
@parcel/transformer-babel | Yarn - Package Manager
If no filesystem config is found it uses a default config that supports the mos ... All notable changes to Parcel will be...
Read more >
parcel/transformer-sass v2.8.0 - npm.io
Out of the box support for JS, CSS, HTML, file assets, and more - no plugins to install. Automatically transforms modules using Babel,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found