not working with preact-cli generated app
See original GitHub issueI generated default template using preact-cli, install preact-fluid, import component but it said
✖ ERROR ./src/components/header/index.js
Module not found: Error: Can't resolve 'preact-fluid' in '/Users/azul/Sites/preactfluid/src/components/header'
@ ./src/components/header/index.js 13:0-38
@ ./src/components/app.js
@ ./src/index.js
@ ./node_modules/preact-cli/lib/lib/entry.js
@ multi ./node_modules/preact-cli/lib/lib/entry webpack-dev-server/client webpack/hot/dev-server
my header component
import { h, Component } from "preact";
import { Link } from "preact-router/match";
// import style from './style';
import { Button } from "preact-fluid";
export default class Header extends Component {
render() {
return <Button>Hello World</Button>;
}
}
my package.json
{
"private": true,
"name": "preactfluid",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"start": "if-env NODE_ENV=production && npm run -s serve || npm run -s dev",
"build": "preact build",
"serve": "preact build && preact serve",
"dev": "preact watch",
"lint": "eslint src",
"test": "jest ./tests"
},
"eslintConfig": {
"extends": "eslint-config-synacor"
},
"eslintIgnore": [
"build/*"
],
"devDependencies": {
"eslint": "^4.9.0",
"eslint-config-synacor": "^2.0.2",
"identity-obj-proxy": "^3.0.0",
"if-env": "^1.0.0",
"jest": "^21.2.1",
"preact-cli": "^2.1.0",
"preact-render-spy": "^1.2.1"
},
"dependencies": {
"preact": "^8.2.6",
"preact-compat": "^3.17.0",
"preact-fluid": "^0.5.8",
"preact-router": "^2.5.7"
},
"jest": {
"verbose": true,
"setupFiles": [
"<rootDir>/src/tests/__mocks__/browserMocks.js"
],
"testURL": "http://localhost:8080",
"moduleFileExtensions": [
"js",
"jsx"
],
"moduleDirectories": [
"node_modules"
],
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/tests/__mocks__/fileMock.js",
"\\.(css|less|scss)$": "identity-obj-proxy",
"^./style$": "identity-obj-proxy",
"^preact$": "<rootDir>/node_modules/preact/dist/preact.min.js",
"^react$": "preact-compat",
"^react-dom$": "preact-compat",
"^create-react-class$": "preact-compat/lib/create-react-class",
"^react-addons-css-transition-group$": "preact-css-transition-group"
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (1 by maintainers)
Top Results From Across the Web
App doesn't render properly with preact build --no-prerender
When I inspected the header element in browser, all the DOM elements in header do not have any classes, hence the styles are...
Read more >Getting Started | Preact: Fast 3kb React alternative with the ...
This guide helps you get up and running to start developing Preact apps, using 3 popular options. If you're new to Preact, we...
Read more >preact build does not work when Webpack 5 is installed
After giving this a day and researching it with fresh eyes, I found that this is simply not possible yet; the preact-cli team...
Read more >preact-cli | Yarn - Package Manager
preact -cli. owner preactjs39.4kMIT3.4.3TS vulns 30 vulnerabilities. Start building a Preact Progressive Web App in seconds. preact, cli, pwa, project ...
Read more >Building a Small PWA with Preact and Firebase - Dan Denney
Sass support requires a flag, so after installing the CLI, I ran preact create app --sass and then dragged the files out to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sabeurthabti works like a charm! 🚀
@sabeurthabti you can publish changes now. We can have a look into adding circle-ci, I will try playing around it in coming days.