Git Product home page Git Product logo

Comments (14)

h-a-n-a avatar h-a-n-a commented on June 29, 2024 4

@xc2 thanks a lot but why string literal change the behavior?

@krutoo That's not expected for us. We will fix this. ;-)

from rspack.

h-a-n-a avatar h-a-n-a commented on June 29, 2024 1

This was fixed in DefinePlugin refactor.

from rspack.

h-a-n-a avatar h-a-n-a commented on June 29, 2024

I was not able to reproduce this panic locally. Here's what I get:

❯ npm run build

> [email protected] build
> rspack

ERROR in ./src/pages/authors/index.tsx
  × Package subpath './preset/node-handler' is not defined by "exports" in /Users/bytedance/Projects/rspack-issue-reproduce/isomorph-bun-vs-node/node_modules/@sima-land/isomorph/package.json


ERROR in ./src/pages/posts/index.tsx
  × Package subpath './preset/node-handler' is not defined by "exports" in /Users/bytedance/Projects/rspack-issue-reproduce/isomorph-bun-vs-node/node_modules/@sima-land/isomorph/package.json


Rspack compiled with 2 errors in 972 ms

from rspack.

krutoo avatar krutoo commented on June 29, 2024

@h-a-n-a I dont see errors like on your case, do you use ubuntu?

from rspack.

krutoo avatar krutoo commented on June 29, 2024

@h-a-n-a can you also make cat ./node_modules/@sima-land/isomorph/package.json | grep node-handler?

Because this export is defined in package.json

from rspack.

xc2 avatar xc2 commented on June 29, 2024

@krutoo please provide the sima-land-isomorph-0.0.0.tgz file.

public version of @sima-land/isomorph has no exports related to node-handler

from rspack.

krutoo avatar krutoo commented on June 29, 2024

@krutoo please provide the sima-land-isomorph-0.0.0.tgz file.

public version of @sima-land/isomorph has no exports related to node-handler

@xc2 Folder "./tgz" in repo (sorry for wrong path in package.json, repo now is updated)

please also use npm run dev

from rspack.

xc2 avatar xc2 commented on June 29, 2024

just tried ubuntu 20.04(x86_64) and debian bookworm(arm64) with no luck to reproduce.

weird

from rspack.

krutoo avatar krutoo commented on June 29, 2024

Hmmm, i fully remove node_modules and reinstall it and it works, soory for taking your time

from rspack.

krutoo avatar krutoo commented on June 29, 2024

@xc2 @h-a-n-a i found that it was my stashed code

try this branch please (npm run dev)
https://github.com/krutoo/isomorph-bun-vs-node/tree/rspack-panic

here is my result:
image

from rspack.

xc2 avatar xc2 commented on June 29, 2024

thanks @krutoo it reproduces.

it is caused by code below

import( /* webpackIgnore: true */ `bun:jsc`)

swc will transform it into import("bun:jsc"); by default when the request is in template literals. playground

there're two approach to avoid:

  1. modify it to import( /* webpackIgnore: true */ "bun:jsc"): playground
  2. or turn jsc.preserveAllComments on for builtin:swc-loader: playground

#5775 this issue will also help

from rspack.

krutoo avatar krutoo commented on June 29, 2024

@xc2 thanks a lot but why string literal change the behavior?

from rspack.

stale avatar stale commented on June 29, 2024

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

from rspack.

krutoo avatar krutoo commented on June 29, 2024

bump

from rspack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.