question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`preact build` not respecting `preact.config.js` webpack entrypoint?

See original GitHub issue

Do you want to request a feature or report a bug? Bug

What is the current behavior? Hey fam! I’m using the preact-cli-plugin-typescript plugin, and also changing the entrypoint to index.tsx instead of index.js. The npm start dev build WORKS, but the npm run build and preact build breaks with error:

multi ./src/index.js
Module not found: Error: Can't resolve '/Users/ben/Code/Web/fridaypoetry.org/src/index.js' in '/Users/ben/Code/Web/fridaypoetry.org/src'
 @ multi ./src/index.js
Build failed!

I’ve also tried various things like preact build --config=preact.config.js --src=src/index.tsx, but it seems very intent on running from an index.js…

Can't resolve '/Users/ben/Code/Web/fridaypoetry.org/src/index.tsx/index.js'

EDIT: Not sure if it’s related, but preact watch works, while preact watch --prerender fails with error: https://gist.github.com/ivebencrazy/bccdc25583e1147bb44a922278007c9c

Template execution failed: Error: Cannot find module '/Users/ben/Code/Web/fridaypoetry.org/build/ssr-build/ssr-bundle.js'
  Error: Cannot find module '/Users/ben/Code/Web/fridaypoetry.org/build/ssr-build/ssr-bundle.js'

If the current behavior is a bug, please provide the steps to reproduce. Configuration Link: https://github.com/ivebencrazy/fridaypoetry.org/blob/preact-cli/preact.config.js

You won’t be able to run this project in its current state unless you npm link to: https://github.com/Blanket-Warriors/Zuck/tree/zuck-ui. But I can make a branch that doesn’t depend on that if it would help.

What is the expected behavior? I’d expect it to complete the build, since the dev build works.

Please mention other relevant information.

  • Node: v7.10.0
  • npm: v4.2.0
  • preact-cli: v1.4.1
  • macOS Sierra: v10.12.6

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bpevscommented, Sep 8, 2017

This works. Thanks @variable-content. Altho it’s slightly disappointing that this basically just means that changing the entrypoint is not supported, @lukeed? But that’s just me being picky haha. Thank you both for the help in getting my project working! 🎉

1reaction
variable-contentcommented, Sep 8, 2017

Take a look at this issue on the plugin’s repo: https://github.com/wub/preact-cli-plugin-typescript/issues/3

There’s suggestions from myself and @fend25 which should help get you started.

Read more comments on GitHub >

github_iconTop Results From Across the Web

preact build not respecting preact.config.js webpack entrypoint ...
I'm using the preact-cli-plugin-typescript plugin, and also changing ... preact build not respecting preact.config.js webpack entrypoint?
Read more >
preact-cli project says “Can't resolve 'react'” when adding react ...
It looks like you're using preact-cli@2 and preact@8 - there's an issue right now where Preact CLI v3 actually scaffolds Preact CLI v2...
Read more >
Preact - multiple entry points with multiple builds ... - Dirask
In this short article, we would like to show how to configure Preact to work with multiple entry points. Warning: by default Preact...
Read more >
@jetshop/react-scripts - npm
Create server-rendered universal JavaScript applications with no configuration. ... Customizing Babel Config; Extending Webpack; CSS Modules.
Read more >
Preact CLI
Preact CLI takes the pain out of starting a new project, getting you up and running instantly with a minimal and understandable project...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found