Questions tagged [preact-cli]

15 questions
21
votes
6 answers

Is there any Yarn equivalent of npx preact create?

I am trying to run the preact create command using Yarn. It's simple to run preact create ..... ..... or npx preact create ... ..... It works fine and both of the commands use npm. But I am trying to run the command using Yarn. I have tried the…
user12987437
2
votes
0 answers

Cloud Firestore build error with preact-cli

I'm trying to use Firebase's Cloud Firestore from a preact-cli generated project but have been caught at the first hurdle. I chose Firebase's v9 SDK, that's in beta, to get ahead of the curve (but maybe that was a mistake). When building, there's an…
DrYap
  • 6,525
  • 2
  • 31
  • 54
1
vote
1 answer

preact-cli has high severity vulnerabilities and npm audit fix runs in circles (3.0.5 <-> 2.2.1)

I'm setting up a preact project with preact-cli: npx --version # 7.4.0 npx preact-cli create typescript frontend This tells me: ... added 1947 packages, and audited 1948 packages in 31s 129 packages are looking for funding run `npm fund` for…
lhk
  • 27,458
  • 30
  • 122
  • 201
0
votes
1 answer

Preact change webpack css loader config

I'd like to change the webpack config on Preact to have only hashed class names, and make them shorter as well if it's a safe practice. The css loader works fine on my preact project but sometimes the component is visible in the class names even…
0
votes
0 answers

How do I embed a preact app on an existing page

I've built a simple preact app using the default setup with preact cli's preact create. Building my app using preact build, the build folder contains index.html as an entry point/file, meaning my app is built as a stand-alone site. What I would…
artooras
  • 6,315
  • 9
  • 45
  • 78
0
votes
1 answer

The default project created by preact-cli "^3.4.2" doesn't run

I'm trying to start a preact project. But the default template created by preact-cli doesn't run. Here's what I did: npx preact-cli create default my-project cd my-project npm install # this is not necessary I think npm run dev This results in an…
lhk
  • 27,458
  • 30
  • 122
  • 201
0
votes
1 answer

Resolve preact Brotli build conflict: same filename

current behavior preact build --brotli prints the following error: ‼ WARN Conflict: Multiple assets emit different content to the same filename .br other relevant information My app is a standard preact-cli 'Default' (preact-cli template). Not…
jsgbc
  • 3
  • 3
0
votes
0 answers

Why am I getting "Cannot read properties of undefined (reading 'hasOwnProperty')" for an Autocomplete component

I am using the Autocomplete MUI component in a Preact app using Preact-cli. When I click into the textfield of the autocomplete component I get the following error. Failed prop type: Cannot read properties of undefined (reading 'hasOwnProperty') …
P.Bjur
  • 13
  • 4
0
votes
1 answer

Error: Unexpected '!'. Escaping special characters with \ may help. - Preact build failing with no location

Error: Unexpected '!'. Escaping special characters with \ may help. - Preact build failing with no location Preact production build is failing without giving any error location after additional chunk assets processing Going after all '!' manually…
0
votes
0 answers

Deploy build folder from Preact app to shared hosting

I have an app built in Preact, and loaded the /build folder contents to my shared hosting space. When I went to that space from my domain name, nothing loaded. Is there an issue loading Preact and SSR apps vs how React generates files from an…
Matt
  • 1,561
  • 5
  • 26
  • 61
0
votes
1 answer

Where do I find a proper doc on preact ejs variables?

I decided to move my react hobby project from react to preact and struggling with the documentation. Most of the information I got was either from the existing examples or issue discussions on the github. But what still didn't find is the info on…
RCKT
  • 141
  • 2
  • 12
0
votes
2 answers

How to add react-router to preact app from preact-cli

I created a Preact app using the preact-cli, and need to add react-router-dom to my project for routing. How can I add react-router to the project without ejecting the app, in order to install the router library? I've seen options for adding…
Matt
  • 1,561
  • 5
  • 26
  • 61
0
votes
0 answers

How to configure i18n.config.js so that `preact build --prerenderUrls ./prerender-urls.js` succeeds?

I have a frontend project setup with preact-cli, which leverages i18next with http-backend. This configuration is to facilitate the serving of the translations on demand from the CDN the app is to run in production on. So far I can get this to work…
Kevin Johnson
  • 1,890
  • 13
  • 15
0
votes
1 answer

preact build does not work when Webpack 5 is installed

I'm working on a production Preact application that also uses Webpack. In that project, trying to run preact build from an npm build script failed. Following that, I created a minimal Preact application using npx preact-cli create default…
Lightning
  • 386
  • 3
  • 15
0
votes
1 answer

Why is preact not getting recognized in the terminal even after installing it?

I have installed Preact but it’s not getting recognized in the terminal. First, I went to the official website of PreactJS. The doc says that I have to run npm install -g preact-cli. As I am using Yarn, I ran yarn global add preact-cli. It was…
user12987437