Comments (11)
Same error Cannot find module 'prettier-plugin-tailwindcss'
from prettier_action.
I was having this same issue with prettier_action v4.3
(and the config files shown below) and was able to work around it by adding an npm install
step before calling the action to install the plugin to the runner rather than relying on the action to do it which seems to get it to work -- not sure if that helps with debugging this or helps anyone else work around it?
Here's my (now) working workflow file for reference
...
jobs:
build-and-test:
name: 'Build, Format and Test'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: NPM Install
run: npm i
- name: Run Prettier
if: ${{ github.ref != 'refs/heads/main' }}
uses: creyD/prettier_action@master
with:
prettier_options: --write {**/*,*}.{js,jsx,mjs,cjs,ts,tsx,css,scss,sass}
file_pattern: "src"
prettier_plugins: "prettier-plugin-tailwindcss"
...
my .prettierrc.js
/** @type {import("prettier").Options} */
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
semi: true,
singleQuote: true,
jsxSingleQuote: true,
plugins: ['prettier-plugin-tailwindcss'],
};
and my devDependencies
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.47.0",
"eslint-plugin-jest-dom": "^5.0.2",
"eslint-plugin-react": "^7.33.2",
"prettier": "^3.0.2",
"prettier-plugin-tailwindcss": "^0.5.3",
"tailwindcss": "^3.3.3"
},
from prettier_action.
@creyD What would be the ETA on having this bug resolved. My dev team's project uses your action as part of our build checks
from prettier_action.
@karkir0003 Can you please try with version 4.3?
from prettier_action.
It seems like using version 4.3 works @creyD. I'll keep you posted if another error comes up
from prettier_action.
Good, @andershagbard Please confirm that it works with 4.3 for you too.
from prettier_action.
Feels like the problem is this:
Lines 62 to 65 in 31355f8
from prettier_action.
Feels like the problem is this:
Lines 62 to 65 in 31355f8
@timsu92 I don't think that's the issue. "prettier-plugin-tailwindcss"
matches that regex, and that's not the error message being presented anyway.
I'm seeing the same issue with v4.3: 'Cannot find module 'prettier-plugin-organize-imports'
.
name: Prettier
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Prettify code
uses: creyD/[email protected]
with:
dry: true
prettier_options: --check *.{mj,t}s examples/**/* packages/*/src/** packages/*/dev/** packages/react-querybuilder/genericTests/** website/*.js website/{docs,src,versioned_docs,versioned_sidebars}/**
prettier_plugins: 'prettier-plugin-organize-imports'
- name: Git diff
if: ${{ failure() }}
run: git diff && exit 1
from prettier_action.
@jakeboone02 Any ideas on how to fix this?
from prettier_action.
@creyD I'm not sure if this will help, but I had a similar issue when trying to use Prettier's JavaScript API from Bun. The solution to that particular problem was to specify the location of the /node_modules
directory with the pluginSearchDirs
option (--plugin-search-dir
on the command line). Seemed unnecessary but, like I said, it resolved the issue.
from prettier_action.
I can confirm
- This is not fixed with version 4.3
- The workaround with
npm install prettier prettier-plugin-java --save-dev
works.
from prettier_action.
Related Issues (20)
- [BUG] Problem running prettier in workflow HOT 5
- [BUG] Doesn't fail on infer parser failed HOT 4
- [BUG] Shouldn't delete node_modules HOT 8
- [BUG] Actions Fails to install/use modules - Cannot find module '@prettier/plugin-php'
- [BUG] `prettier` not installed correctly HOT 9
- [BUG] prettier: command not found HOT 3
- [BUG] Problem --writer HOT 4
- [BUG] Process completed with exit code 1 HOT 5
- [BUG] Example not working. HOT 4
- IDEA: Add push_options parameter HOT 3
- [BUG] Error: Process completed with exit code 1 when using prettier-php HOT 12
- [BUG] Code style issues found, can't reproduce locally HOT 2
- [FEATURE] Format only changed lines not the whole file HOT 1
- [BUG] Should work when package-lock.json is not versioned HOT 3
- [FEATURE] Don't log unchanged files
- [BUG] Dry run fails in spite of the fact that a line length does not exceed 80 chars. HOT 2
- What is status code 128? HOT 5
- Readme out of date
- [FEATURE] Print the `prettier` command to be executed before executing it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier_action.