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

"Uncaught TypeError" after running deno bundle #8574

Closed
maximousblk opened this issue Dec 1, 2020 · 1 comment · Fixed by #8588
Closed

"Uncaught TypeError" after running deno bundle #8574

maximousblk opened this issue Dec 1, 2020 · 1 comment · Fixed by #8588
Labels
bug Something isn't working correctly swc related to swc (bundling/transpiling)

Comments

@maximousblk
Copy link

maximousblk commented Dec 1, 2020

screenshot:

image

code:

// mod.ts

import { request } from "https://cdn.skypack.dev/@octokit/request";

const { data } = await request('GET /repos/{owner}/{repo}/license', {
  headers: {
    authorization: `token ${Deno.env.get('GITHUB_TOKEN')}`,
  },
  owner: 'denoland',
  repo: 'deno'
})

console.log(data.license.name);
@kitsonk kitsonk added bug Something isn't working correctly swc related to swc (bundling/transpiling) labels Dec 2, 2020
@kitsonk
Copy link
Contributor

kitsonk commented Dec 2, 2020

Tried with master and it seems to be related to this module. The following is getting dropped from the bundle, which is causing the variable to be undefined:

if (typeof window !== "undefined") {
  globalContext = window;
} else if (typeof self !== "undefined") {
  globalContext = self;
} else {
  globalContext = {};
}

cc/ @kdy1

@kdy1 kdy1 mentioned this issue Dec 2, 2020
5 tasks
kdy1 added a commit to kdy1/swc that referenced this issue Dec 2, 2020
kdy1 added a commit to swc-project/swc that referenced this issue Dec 2, 2020
swc_bundler:
 - Reduce level of logging.
 - Handle export specifiers without alias. (denoland/deno#8573)
 - Handle normal initialization while reordering statements. (denoland/deno#8574)
 - Handle top level `await`s in wrapped modules. (denoland/deno#8584)
 - Add benchmark for the bundler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly swc related to swc (bundling/transpiling)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants