I am trying to capture a screenshot of my website running in localhost and i am using Spatie/Browsershot.
When i try to run this function
public function receipt(){
$image = Browsershot::url('http://localhost:8000/transaction/receipt/123')
->setNodeBinary('C:\Users\\my_user\\nodejs\\node.exe')
->setNpmBinary('C:\Users\\my_user\\nodejs\\npm.exe')
->base64Screenshot();
return $image;
}
This error popped up
Symfony\Component\Process\Exception\ProcessFailedException
The command "C:^\Users^\Abimanyu^\nodejs^\node.exe ^"D:^\laravel_projects^\teliti-core-app^\vendor^\spatie^\browsershot^\src/../bin/browser.js^" ^"^{^\^"url^\^":^\^"http:^\/^\/localhost:8000^\/transaction^\/receipt^\/123^\^",^\^"action^\^":^\^"screenshot^\^",^\^"options^\^":^{^\^"type^\^":^\^"png^\^",^\^"args^\^":^[^],^\^"viewport^\^":^{^\^"width^\^":800,^\^"height^\^":600^},^\^"executablePath^\^":^\^"C:^\^\Users^\^\Abimanyu^\^\AppData^\^\Local^\^\Google^\^\Chrome^\^\Application^\^\chrome.exe^\^"^}^}^"" failed. Exit Code: 1(General error) Working directory: D:\laravel_projects\teliti-core-app\public Output: ================ Error Output: ================ [Error: ENOENT: no such file or directory, mkdtemp 'undefined\temp\puppeteer_dev_chrome_profile-XXXXXX'] { errno: -4058, code: 'ENOENT', syscall: 'mkdtemp', path: 'undefined\\temp\\puppeteer_dev_chrome_profile-XXXXXX' }
I've tried setting the custom path to these attributes:
setChromePath("C:\Users\my_user\AppData\Local\Google\Chrome\Application\chrome.exe")
setNpmBinary('C:\Users\my_user\AppData\Roaming\npm')
I've also run npm install puppeteer.
Additional :
Laravel 8
Windows 10
Node v14.17.2
Anyone any ideas on what i am doing wrong?
Related
I recently upgraded my Blog made with Astro 1.0 to the new Astro 2.0 using the next command:
npm install astro#latest
But when I try to run my project in development mode with npm run dev I found the next error:
[ERROR] Could not resolve "path-browserify"
node_modules/#astrojs/rss/dist/util.js:1:18:
1 │ import npath from "path-browserify";
╵ ~~~~~~~~~~~~~~~~~
You can mark the path "path-browserify" as external to exclude it from the bundle, which will
remove this error.
/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1604
let error = new Error(`${text}${summary}`);
^
Error: Build failed with 1 error:
node_modules/#astrojs/rss/dist/util.js:1:18: ERROR: Could not resolve "path-browserify"
at failureErrorWithLog (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1604:15)
at /Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1056:28
at runOnEndCallbacks (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1476:61)
at buildResponseToResult (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1054:7)
at /Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:1166:14
at responseCallbacks.<computed> (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:701:9)
at handleIncomingPacket (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:756:9)
at Socket.readFromStdout (/Users/victoralvarado/Development/My Projects/vicbox-tech/node_modules/esbuild/lib/main.js:677:7)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12) {
errors: [
{
detail: undefined,
id: '',
location: {
column: 18,
file: 'node_modules/#astrojs/rss/dist/util.js',
length: 17,
line: 1,
lineText: 'import npath from "path-browserify";',
namespace: '',
suggestion: ''
},
notes: [
{
location: null,
text: 'You can mark the path "path-browserify" as external to exclude it from the bundle, which will remove this error.'
}
],
pluginName: '',
text: 'Could not resolve "path-browserify"'
}
],
warnings: []
}
I don’t know exactly why and I tried many things to fix that without a positive result.
The last thing that I do was update the npm dependencies with a simple command npm update and the error was going. It was that way how to solve the error.
I ran the npm update command expecting some deprecated library or dependency to update and fix the error.
When I write the command npm install && npm run dev it always appears like this
Error: error:0308010C:digital envelope routines::unsupported
Error: error:0308010C:digital envelope routines::unsupported
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.8.0
Making my first laravel 6 by using laragon and fron-end vue
I'm trying to deploy my Nextjs app to Vercel, I am using strapi backend deployed at Heroku...
Unfortunately I am stuck at this build error at Vercel....
I have googled and tried to find a solution but unfortunately I can't and have no idea what to do.
Any ideas appreciated....
> Build error occurred
Error: Unexpected token M in JSON at position 0
at new ApolloError (/vercel/path0/node_modules/#apollo/client/errors/errors.cjs:34:28)
at /vercel/path0/node_modules/#apollo/client/core/core.cjs:1595:19
at both (/vercel/path0/node_modules/#apollo/client/utilities/utilities.cjs:986:53)
at /vercel/path0/node_modules/#apollo/client/utilities/utilities.cjs:979:72
at new Promise (<anonymous>)
at Object.then (/vercel/path0/node_modules/#apollo/client/utilities/utilities.cjs:979:24)
at Object.error (/vercel/path0/node_modules/#apollo/client/utilities/utilities.cjs:987:49)
at notifySubscription (/vercel/path0/node_modules/zen-observable/lib/Observable.js:140:18)
at onNotify (/vercel/path0/node_modules/zen-observable/lib/Observable.js:179:3)
at SubscriptionObserver.error (/vercel/path0/node_modules/zen-observable/lib/Observable.js:240:7) {
type: 'ApolloError',
graphQLErrors: [],
clientErrors: [],
networkError: {
name: 'ServerParseError',
response: { size: 0, timeout: 0 },
statusCode: 405,
bodyText: 'Method Not Allowed'
}
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1
When running npx semantic-release-cli setup with GitHub Actions for my public repository https://github.com/henrycity/movie-browser-frontend, I got this error
ERR! semantic-release RequestError: Error: Invalid URI "undefined/repos/henrycity/movie-browser-frontend/actions/secrets/public-key"
ERR! semantic-release at new RequestError (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/node_modules/request-promise-core/lib/errors.js:14:15)
ERR! semantic-release at Request.plumbing.callback (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/node_modules/request-promise-core/lib/plumbing.js:87:29)
ERR! semantic-release at Request.RP$callback [as _callback] (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/node_modules/request-promise-core/lib/plumbing.js:46:31)
ERR! semantic-release at self.callback (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/node_modules/request/request.js:185:22)
ERR! semantic-release at Request.emit (events.js:315:20)
ERR! semantic-release at Request.init (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/node_modules/request/request.js:273:17)
ERR! semantic-release at Request.RP$initInterceptor [as init] (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/node_modules/request-promise-core/configure/request2.js:45:29)
ERR! semantic-release at new Request (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/node_modules/request/request.js:127:8)
ERR! semantic-release at request (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/node_modules/request/index.js:53:10)
ERR! semantic-release at /Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/node_modules/request/index.js:100:12
ERR! semantic-release at createSecret (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/src/lib/github-actions.js:36:28)
ERR! semantic-release at module.exports (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/src/lib/github-actions.js:83:9)
ERR! semantic-release at module.exports (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/src/lib/ci.js:50:17)
ERR! semantic-release at processTicksAndRejections (internal/process/task_queues.js:97:5)
ERR! semantic-release at module.exports (/Users/tri.tran/.nvm/versions/node/v12.18.3/lib/node_modules/semantic-release-cli/src/index.js:90:5)
I tried to log the info object in https://github.com/semantic-release/cli/blob/master/src/lib/ci.js. I notice that info.github.endpoint is undefined, which causes the error.
giturl: 'https://github.com/henrycity/movie-browser-frontend.git',
ghrepo: { slug: [ 'henrycity', 'movie-browser-frontend', '' ] },
npm: {
registry: 'https://npm.pkg.github.com/',
authmethod: 'token',
username: 'henrycity',
password: 'xxxx,
token: 'xxxx'
},
github: { token: 'xxxx }
Version: 5.4.1
I wonder what causes the error.
The issue is fixed in version 5.4.3.
I have install this:
npm install --save getmac
and insert in my home.components.ts this code
import getMAC, { isMAC } from 'getmac';
and in ngOnInit this code text:
console.log(getMAC());
The Console Error is:
core.js:5873 ERROR Error: failed to get the MAC address
at getMAC (index.js:37)
at HomeComponent.ngOnInit (home.component.ts:15)
at callHook (core.js:3937)
at callHooks (core.js:3901)
at executeInitAndCheckHooks (core.js:3842)
at refreshView (core.js:11795)
at refreshDynamicEmbeddedViews (core.js:13142)
at refreshView (core.js:11800)
at refreshComponent (core.js:13217)
at refreshChildComponents (core.js:11508)
Where am I wrong?