Cannot read properties of undefined (reading 'tap') - wordpress

I am trying to create an extension. when I run pnpm start, I got the error:
'configuration.output has an unknown property 'jsonpFunction'.
I fixed it through adding code " defaultConfig.output.chunkLoadingGlobal = defaultConfig.jsonpFunction
delete defaultConfig.output.jsonpFunction" - in webpack.config.js file.
After that, while I doing pnpm start again I got the error
TypeError: Cannot read properties of undefined (reading 'tap')
Any options to fix it??
to create woocommerce extension

Related

SSR compile fails with TailwindCSS "Cannot read properties of undefined (reading '5')

I am making a Github pages site with SvelteKit and Tailwind CSS as a learning project.
I am using Adaptor static to render the site for hosting on github pages so everything ends up getting Server side pre rendered.
Error:
[postcss] Cannot read properties of undefined (reading '5')
21:35:57 [vite-plugin-svelte] ssr compile in progress ...
TypeError: Cannot read properties of undefined (reading '5')
at Parser.parentheses (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:859:65)
at Parser.parse (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:1062:14)
at Parser.loop (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:1043:12)
at new Parser (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:164:10)
at Processor._root (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\processor.js:53:18)
at Processor._runSync (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\processor.js:100:21)
at Processor.astSync (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\processor.js:145:17)
at finalizeSelector (D:\Repositories\myrepo\node_modules\tailwindcss\lib\util\formatVariantSelector.js:125:59)
at D:\Repositories\myrepo\node_modules\tailwindcss\lib\lib\generateRules.js:732:81
at D:\Repositories\myrepo\node_modules\postcss\lib\container.js:96:18
TypeError: Cannot read properties of undefined (reading '5')
at Parser.parentheses (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:859:65)
at Parser.parse (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:1062:14)
at Parser.loop (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:1043:12)
at new Parser (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:164:10)
at Processor._root (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\processor.js:53:18)
at Processor._runSync (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\processor.js:100:21)
at Processor.astSync (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\processor.js:145:17)
at finalizeSelector (D:\Repositories\myrepo\node_modules\tailwindcss\lib\util\formatVariantSelector.js:125:59)
at D:\Repositories\myrepo\node_modules\tailwindcss\lib\lib\generateRules.js:732:81
at D:\Repositories\myrepo\node_modules\postcss\lib\container.js:96:18
Error: Not found: /favicon.ico
at resolve (/node_modules/#sveltejs/kit/src/runtime/server/respond.js:395:13)
at resolve (/node_modules/#sveltejs/kit/src/runtime/server/respond.js:236:5)
at Object.#options.hooks.handle (/#fs/D:/Repositories/myrepo/node_modules/#sveltejs/kit/src/runtime/server/index.js:41:55)
at Module.respond (/node_modules/#sveltejs/kit/src/runtime/server/respond.js:233:40)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
TypeError: Cannot read properties of undefined (reading '5')
at Parser.parentheses (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:859:65)
at Parser.parse (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:1062:14)
at Parser.loop (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:1043:12)
at new Parser (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\parser.js:164:10)
at Processor._root (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\processor.js:53:18)
at Processor._runSync (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\processor.js:100:21)
at Processor.astSync (D:\Repositories\myrepo\node_modules\postcss-selector-parser\dist\processor.js:145:17)
at finalizeSelector (D:\Repositories\myrepo\node_modules\tailwindcss\lib\util\formatVariantSelector.js:125:59)
at D:\Repositories\myrepo\node_modules\tailwindcss\lib\lib\generateRules.js:732:81
at D:\Repositories\myrepo\node_modules\postcss\lib\container.js:96:18
I have a Svelte component that has a named tailwind group so that i can do some conditional highlighting.
The basics of the component are like this:
<script>
export let id;
export let title;
const setting= `group/${id}`
</script>
<div class="{setting}">
<div
class="{`group-hover/${id}:bg-blue-500`}"
>
{title}
</div>
<slot/>
</div>
This works in this REPL that uses tailwind strangely! is this issue just to do with SSR?
https://svelteboard.com/repl
When i made this component I had inline declarations of the class with a prenamed group/name like this:
<div class="group/name">
<div
class="group-hover/name:bg-blue"
>
{title}
</div>
<slot/>
</div>
that worked fine (but highlighted all instances of the component on hover.)
but when i changed to the newer implementation it breaks with the above error & even when i roll back to a previous check in the error persists.
Am i implementing something wrong,
my tailwind config is unmodified from the svelte + tailwind setup, and svelte config has vitePreprocess and adapterstatic only.
I Tried updating dependencies to latest versions
downgrading postcss to 8.2 (suggested by another question)
reverting to previous revision, (does fix eventually but still cant implement this feature)
According to docs you cannot define dynamic CSS like group-hover/${id}:bg-blue-500 (Read here). All classes should be defined during build time.
You don't need to use nested groups if there is only one group in the component. Take a look at this REPL.
(If this is not the effect you're looking for please add a REPL with a minimum reproducible example)
#notnavindu's answer is correct
I think you can also refer to this

I am getting the Uncaught TypeError: Cannot read property 'PureComponent' of undefined in my console of the react app.What is it expecting?

I have a react app, that uses react-image-crop package for creating crops of images available in the application.I am using this CSS import for crop CSS properties - import 'react-image-crop/dist/ReactCrop.css'. The below mentioned error is shown in console. What change is it expecting? Uncaught TypeError: Cannot read property 'PureComponent' of undefined,at Module. (VM253 ReactCrop.min.js:1),at r (VM253 ReactCrop.min.js:1)

Could not set unknown property 'configFile' for object of type net.corda.plugins.Node

Follow the sample build.gradle codes in this documentation page, I added one "configFile" into node's definition here, but after refreshed the gradle project, when build the app there is an error:
Could not set unknown property 'configFile' for object of type net.corda.plugins.Node.
Did I miss adding anything in the build.gradle?
Set the configFile without '=' sign.
For Eg:
configFile "/Users/mac_user/Documents/resources/nodea.conf" in node of the build.gradle file.

typescript compile error with unknown google.maps object type

While compiling typescript I get an error:
src\app\foo.ts (129,25): Index signature of object type
implicitly has an 'any' type. (7017)
on the following line:
const tmode = google.maps['DirectionsTravelMode'].DRIVING;
google.maps.DirectionsTravelMode doesn't exist in my typings file which I installed using typings install google.maps --save --ambient
I could add it but it would be lost when I checkout my project and reinstall the typings.
This is just one item in the file which is preventing my build from succeeding. What is the easiest way to get typescript to ignore this line? I have tested the code already and it runs correctly.
You could extend the module yourself:
declare module google.maps {
export enum DirectionsTravelMode {
DRIVING
}
}
NOTE: this would have to go in a declaration file such as mygoogle.d.ts.
Index signature of object type implicitly has an 'any' type.
Instead of indexing just assert the any yourself:
const tmode = (google.maps as any).DirectionsTravelMode.DRIVING;

`Exception in template helper: TypeError: Cannot read property 'undefined' of undefined

I made a site using Telescope but when load I get this error message in my browser-console. How to fix this error.
Exception in template helper: TypeError: Cannot read property 'undefined' of undefined
at Object.Template.avatar.helpers.size (http://localhost:3000/packages/utilities_avatar.js?76304dc56cbb0aaaef4d60c3d930750cea5ac835:96:37)
at bindDataContext (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2880:16)
at Blaze._wrapCatchingExceptions (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:1651:16)
at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2928:66
at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:3476:12)
at wrapHelper (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2927:27)
at Spacebars.call (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:172:18)
at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:109:25)
at Object.Spacebars.mustache (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:113:39)
at Template.avatar.HTML.DIV.class (http://localhost:3000/packages/utilities_avatar.js?76304dc56cbb0aaaef4d60c3d930750cea5ac835:48:82)
Here is answer for your problem: Stack-link
Read about guarding, problem you have appears due to missing variable / key / method, because it is not yet loaded. It mostly works cause it gets loaded but unless it comes to webbrowser you recieve this error message.
Go and look through your app and look close to the Template's name and the helpers, events. Maybe a Template.yourtemplate.helper or Template.yourtemplate.event isnt equal with your HTML Template name

Resources