Laravel Spatie\Browsershot Error For some reason Chrome did not write a file at `/home/______/public_html/myfiles/storage/public/cv/file.pdf - laravel

Spatie\Browsershot
Laravel
My Code :
$save_to_file = storage_path('public/cv/file.pdf');
Browsershot::html('<h1>test<h1>')
->noSandbox()
->save($save_to_file);
The Error :
For some reason Chrome did not write a file at `/home/______/public_html/myfiles/storage/public/cv/file.pdf`.

Maybe try this : how to fix Spatie/Browsershot error somehow Chrome did not write a file at `screenshot.pdf`
This work for me with spatie/browsershot in GitHub Actions CI.
Although composer install puppetter, installing manually puppetter and chromium on the system made the generation of PDFs work.
npm install -g puppeteer
npm install -g chromium

Related

How to install Laravel Vite?

The Laravel Vite Doc sais to run:
npx apply laravel:vite --ignore-existing
inside your project root to install vite in your laravel project.
When I try to do that in a freshly installed laravel project it shows this:
zsh:1: command not found: laravel:vite
What am I doing wrong?
Using Macos Big Sur with PhpStorm.
That command no longer applies to newly created projects (as of laravel-vite 0.1.27, released a few days ago), and it now results in a different error:
$ npx apply laravel:vite --ignore-existing
[ info ] Applying preset laravel:vite.
[ error ] The preset could not be evaluated.
evalmachine.<anonymous>:13
var preset_default = definePreset({
^
ReferenceError: definePreset is not defined
at evalmachine.<anonymous>:13:22
at Script.runInContext (node:vm:139:12)
at Object.runInContext (node:vm:289:6)
at ModuleImporter.evaluateConfiguration (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Importer/ModuleImporter.js:68:26)
at ModuleImporter.import (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Importer/ModuleImporter.js:17:27)
at PresetApplier.run (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Applier/PresetApplier.js:22:87)
at async CommandLineInterface.apply (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/IO/CommandLineInterface.js:57:16)
at async CommandLineInterface.run (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/IO/CommandLineInterface.js:54:16)
However, the command shown in the laravel-presets/vite repository (the source repo for the laravel:vite preset) worked for me -- i.e., it augmented the Laravel project with Vite:
# Run this command from root of Laravel project
npx #preset/cli apply --debug laravel:vite
#preset/cli currently suppresses all output (including errors), so the --debug flag above is important. Since the verbose log is difficult to follow, I recommend redirecting the output to a file, and searching it for the word exception.
Tips
To ensure the preset succeeds, you must have php#8.0 (e.g., from Homebrew) and composer installed and available from the command line. Add the paths to those binaries to your PATH environment variable.
The Vite server must be started separately from the PHP server. Run npm run dev in one terminal; and php artisan serve from another.
Vite is now the default frontend asset bundler in laravel which replaces webpack. No additional installations are needed for new projects.
https://laravel-news.com/vite-is-the-default-frontend-asset-bundler-for-laravel-applications

Next JS: unable to use scss on Windows

I am building a Next JS application. To admit, this is my first exposure to Next JS. Now, I am having a problem using SCSS with my Next JS application. I have created a file called, assets/auth.scss. Then I imported it into pages/_app.js as follow.
import '../assets/auth.scss';
When I run "npm run dev", I am getting the following error.
./node_modules/next/dist/compiled/css-loader/cjs.js??ruleSet[1].rules[2].oneOf[7].use[1]!./node_modules/next/dist/compiled/postcss-loader/cjs.js??ruleSet[1].rules[2].oneOf[7].use[2]!./node_modules/nex
t/dist/compiled/resolve-url-loader/index.js??ruleSet[1].rules[2].oneOf[7].use[3]!./node_modules/next/dist/compiled/sass-loader/cjs.js??ruleSet[1].rules[2].oneOf[7].use[4]!./assets/auth.scss
Error: Node Sass version 6.0.1 is incompatible with ^4.0.0 || ^5.0.0.
Error: Cannot find module 'C:\Users\Acer\Desktop\shar-kya-mal-next-js\nextjs-blog\.next\build-manifest.json'
Require stack:
Then I tried installing node-sass package too. It still does not work. How can I fix it?
Do you use npm install sass or node sass? Every next project where i will use scss i use npm install sass and it works normally. Do you do something different?
Try to use npm install sass or yarn install sass

"This dependancy was not found" when i try to import from ckeditor

I try to create a custom plugin. Wheni import Image from '#ckeditor/ckeditor5-image/src/image' i get an error
This dependency was not found:
* -!../../../css-loader/index.js??ref--6-oneOf-3-1!../../../postcss- loader/src/index.js??ref--6-oneOf-3-2!./#ckeditor/ckeditor5-theme- lark/theme/mixins/_rwd.css in ./node_modules/css-loader??ref--6-oneOf-3-
1!./node_modules/postcss-loader/src??ref--6-oneOf-3-
2!./node_modules/#ckeditor/ckeditor5-image/theme/textalternativeform.css
To install it, you can run: npm install --save -!../../../css-
loader/index.js??ref--6-oneOf-3-1!../../../postcss-loader/src/index.js??
ref--6-oneOf-3-2!./#ckeditor/ckeditor5-theme-lark/them
How should i fix it? I've installed this package https://github.com/ckeditor/ckeditor5-theme-lark and there is no effect.
Make sure you have created the vue.config.js file and included the details from
https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs.html
Make sure #ckeditor/ckeditor5-theme-lark is installed
npm install --save #ckeditor/ckeditor5-theme-lark
That should then fix the issue
after modified the vue.config.js make sure you are re-run again your VUE application
npm run dev
or
npm run serve
In my case, I got same error because I did not follow the guide very well. After read it I had to run this:
npm install #ckeditor/ckeditor5-theme-lark
npm install --save #ckeditor/ckeditor5-vue2 #ckeditor/ckeditor5-dev-webpack-plugin #ckeditor/ckeditor5-dev-utils postcss-loader#4 raw-loader#4
For specific modules selected, something like this:
npm install --save #ckeditor/ckeditor5-basic-styles #ckeditor/ckeditor5-editor-classic #ckeditor/ckeditor5-horizontal-line #ckeditor/ckeditor5-alignment #ckeditor/ckeditor5-autosave #ckeditor/ckeditor5-adapter-ckfinder #ckeditor/ckeditor5-essentials #ckeditor/ckeditor5-font #ckeditor/ckeditor5-heading #ckeditor/ckeditor5-image #ckeditor/ckeditor5-indent #ckeditor/ckeditor5-link #ckeditor/ckeditor5-list #ckeditor/ckeditor5-paragraph #ckeditor/ckeditor5-paste-from-office #ckeditor/ckeditor5-remove-format #ckeditor/ckeditor5-typing #ckeditor/ckeditor5-basic-styles
Then, in my case I use VUE 2+ version, so I had to modify the vue.config.js file, accorging the official documentation: https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/frameworks/vuejs-v2.html
Plase check the documentation with your specific framework: https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/frameworks/overview.html

Your JET project does not have oraclejet-tooling installed

I recently installed Oracle jet and I haven't made any changes to it. I created my first project today and it's showing error when I try to build it or serve it. I am trying to run it on Visual Studio (I don't this matters tho)
This is the error I am getting
PM> ojet serve ojet : [31mError: Your JET project does not have oraclejet-tooling installed.[0m
At line:1 char:
+ ojet serve
+ ~~~~~~~~~~
+ CategoryInfo : NotSpecified: ([31mError: You... installed.[0m:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
UPDATE: Apparently when I create a new template it is creating an error from there itself the app structure is generated but during invoking mom install it is unable to parse through some certain JSON
Following is the Error:
ojet create ojetnavbar --template=navbar
Processing template: navbar
Your app structure is generated. Continuing with library install.
Performing npm install may take a bit.
Invoking npm install.
npm WARN deprecated coffee-script#1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm ERR! Unexpected end of JSON input while parsing near '...oIzTWjIvO8rspcLCK+1pI'
npm ERR! A complete log of this run can be found in:
npm ERR! *location of log*
Error: (during Invoking npm install.) 1
$ npm install -g #oracle/ojet-cli
$ npm install -g #oracle/oraclejet-tooling
$ ojet restore
This will solve your problem
I have sorted out on the issue it was because the JSON npm was trying to parse were mostly cached and due to that a parsing error was occurring
I used npm-cache clean on my PC and all of it ran after that perfectly fine.
I think you need to add oraclejet tooling to your project. Try this:
cd appDir
npm install #oracle/oraclejet-tooling --save
oraclejet-tooling package has been deprecated, you have to use module contains a command-line interface for Oracle JET web and hybrid mobile application development.
See https://www.npmjs.com/package/#oracle/ojet-cli
cd oracle-jet-simple-web
npm install #oracle/ojet-cli --save
For me this helped
npm i #oracle/oraclejet-tooling
Here is the link: npmjs.com/package/#oracle/oraclejet-tooling

Xcode / React Native - "Transform Error - unknown plugin 'module-resolver' "

I am running a build on Xcode for my React Native project and for some reason, when running the build in debug mode, this error appears:
'TransformError: [my directory] : Unknown plugin "module-resolver" ' inside my babelrc file.
I tried to npm install the module-resolver to see if that would get rid of the error however the simulator still has as red screen with that same TransformError.
Any help/guidance on this would be really helpful.
Thanks
You must install the 'babel-plugin-module-resolver'.
You should run:
npm install babel-plugin-module-resolver --save-dev
https://www.npmjs.com/package/babel-plugin-module-resolver

Resources