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

Trunk fails on build when serve on windows #852

Open
JurrianFahner opened this issue Aug 18, 2024 · 3 comments
Open

Trunk fails on build when serve on windows #852

JurrianFahner opened this issue Aug 18, 2024 · 3 comments

Comments

@JurrianFahner
Copy link

When following the yew starting guide it fails in the following way:
image

Workaround is to run trunk build first and then the trunk serve command succeeds.

In my understanding the workaround shouldn't be applied.

Affected trunk versions:

  • 0.20.3
  • 0.20.2
@ctron
Copy link
Collaborator

ctron commented Aug 26, 2024

True, I am wondering why you get an Access is denied error?

@TheExistingOne
Copy link

TheExistingOne commented Oct 6, 2024

I am also encountering this issue using a fresh install of trunk 0.20.3 and cargo 1.81.0 when building a Bevy WASM project. The error didn't occur on macOS and I do have permissions to the directory.

Running trunk build before trunk serve resolves the error for me as well, although I don't have any idea why.

One thing I did find while playing around with it is that manually creating the directory "target/wasm32-unknown-unknown" also allows trunk serve to build. I'm wondering if there may be some difference in the way serve and build initialize directories that's causing strange behavior.

My HTML template and Trunk.toml look like this if that's helpful.

HTML - wasmopt.html

<!-- trunkrs compilation template -->

<html>
  <head>
    <link data-trunk rel="rust" href="Cargo.toml" data-target-name="dither-demo" data-wasm-opt="3"/>
  </head>
</html>

Trunk.toml

# A sem-ver version requirement of trunk required for this project
trunk-version = "*"

[build]
# The index HTML file to drive the bundling process.
target = "wasmopt.html"
# Build in release mode.
release = true
# The output dir for all final assets.
dist = "out/wasmopt"


[clean]
# The output dir for all final assets.
dist = "out/wasmopt"

@JurrianFahner
Copy link
Author

True, I am wondering why you get an Access is denied error?

I don't have a clue. Also no experience yet with debugging trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants