Skip to content

src: add fetch to bootstrap/browser.js - #41958

Closed
RaisinTen wants to merge 2 commits into
nodejs:masterfrom
RaisinTen:add-fetch-to-bootstrap/browser.js
Closed

src: add fetch to bootstrap/browser.js#41958
RaisinTen wants to merge 2 commits into
nodejs:masterfrom
RaisinTen:add-fetch-to-bootstrap/browser.js

Conversation

@RaisinTen

Copy link
Copy Markdown
Member

Fixes: #41816
Signed-off-by: Darshan Sen raisinten@gmail.com

Fixes: nodejs#41816
Signed-off-by: Darshan Sen <raisinten@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/startup

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Feb 13, 2022
@RaisinTen

Copy link
Copy Markdown
MemberAuthor

Hmm, seems to fail during the node_mksnapshot step:

node:internal/options:20({options: optionsMap}=getCLIOptions());^
Error: ShouldnotqueryoptionsbeforebootstrappingisdoneatgetCLIOptionsFromBinding(node:internal/options:20:32)atgetOptionValue(node:internal/options:40:19)
at node:internal/bootstrap/browser:79:5
#
# Fatalerrorinv8::ToLocalChecked
# EmptyMaybeLocal.
#

and the exception is coming from

"Should not query options before bootstrapping is done");
, which was introduced in #26476.

The bootstrap script is run during compilation but the CLI option is passed at runtime.

@joyeecheung is this something we should even be doing? If so, how?

@devsnek

Copy link
Copy Markdown
Member

options are set at runtime. bootstrapping happens at build time. if something needs to check options it should not be part of bootstrapping.

@aduh95

Copy link
Copy Markdown
Contributor

I don't think this can land until we make --experimental-fetch a no op.

@RaisinTen

Copy link
Copy Markdown
MemberAuthor

Ah, yes indeed. I'm closing this because re-exposing fetch when it becomes stable should be much easier to do than fixing git conflicts in this pr.

@RaisinTen
RaisinTen deleted the add-fetch-to-bootstrap/browser.js branch February 14, 2022 16:10
@joyeecheung

Copy link
Copy Markdown
Member

A trick that you can do is to add it during bootstrap unconditionally and then removing it during pre-execution when the option is not on - but yeah it’s probably still too early to do this for fetch.

@RaisinTen

Copy link
Copy Markdown
MemberAuthor

@joyeecheung yes, I did something similar in #41969.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fetch should not be installed if no_browser_globals==true

5 participants

@RaisinTen@nodejs-github-bot@devsnek@aduh95@joyeecheung