Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to import iconoir-react in production mode #11

Open
4 tasks done
ceopaludetto opened this issue Dec 25, 2022 · 1 comment
Open
4 tasks done

Failed to import iconoir-react in production mode #11

ceopaludetto opened this issue Dec 25, 2022 · 1 comment
Labels
bug Something isn't working feat:preview

Comments

@ceopaludetto
Copy link

Describe the bug

When I build an application which uses iconoir-react package for production and try to run remix-kit preview, I get this error:

Screenshot 2022-12-25 at 15 05 26

What I tried:

  1. Added 'type': 'module' in package.json
  2. Added 'iconoir-react': 'iconoir-react/dist/esm' in resolve.alias
  3. Changed from server.production.js to server.production.mjs
  4. Added serverDependenciesToBundle: ['iconoir-react'] in remix.config.js

The development server works like a charm, but production preview throws. Also the same remix project using the default build system works too.

Reproduction

No response

Steps to reproduce

  1. Create a remix-kit project
  2. Add iconoir-react
  3. Build for production
  4. Try to run remix-kit preview

System Info

System:
    OS: macOS 13.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 108.45 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.asdf/installs/nodejs/lts-hydrogen/bin/node
    Yarn: 1.22.19 - ~/.asdf/shims/yarn
    npm: 8.19.2 - ~/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Firefox: 107.0.1
    Safari: 16.2
  npmPackages:
    @remix-kit/cli: ^0.1.2 => 0.1.2 
    @remix-kit/react: ^0.1.2 => 0.1.2 
    @remix-kit/vite: ^0.1.2 => 0.1.2 
    @remix-run/dev: ^1.9.0 => 1.9.0 
    @remix-run/express: ^1.9.0 => 1.9.0 
    @remix-run/node: ^1.9.0 => 1.9.0 
    @remix-run/react: ^1.9.0 => 1.9.0 
    @remix-run/serve: ^1.9.0 => 1.9.0 
    @remix-run/server-runtime: ^1.9.0 => 1.9.0

Used Package Manager

pnpm

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a RemixKit issue and not a Remix specific issue. For example, if it's a Remix related bug, it should likely be reported to remix instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.
@jrestall
Copy link
Owner

Really appreciate the bug report @ceopaludetto! We'll get to improving this as part of the preview feature re-think in the short-term roadmap here.

@jrestall jrestall added bug Something isn't working feat:preview labels Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feat:preview
Projects
None yet
Development

No branches or pull requests

2 participants