-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
Description
TypeScript Version: [email protected]
Code
import { render } from "react-dom";
import * as React from "react";
import { initLocales } from "./gui/components/intl";
document.addEventListener("DOMContentLoaded", (event) => {
initLocales(true);
const [viewComponentName] = new URL(window.location.href).search.substr(1).split("&");
const view = require(`./gui/views/${viewComponentName}`).default;
render(React.createElement(view, null), document.getElementById("appcontainer"));
});Expected behavior:
"use strict";
const react_dom_1 = require("react-dom");
const React = require("react");
const intl_1 = require("./gui/components/intl");
document.addEventListener("DOMContentLoaded", (event) => {
intl_1.initLocales(true);
const [viewComponentName] = new URL(window.location.href).search.substr(1).split("&");
const view = require(`./gui/views/${viewComponentName}`).default;
react_dom_1.render(React.createElement(view, null), document.getElementById("appcontainer"));
});Actual behavior:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_dom_1 = require("react-dom");
const React = require("react");
const intl_1 = require("./gui/components/intl");
document.addEventListener("DOMContentLoaded", (event) => {
intl_1.initLocales(true);
const [viewComponentName] = new URL(window.location.href).search.substr(1).split("&");
const view = require(`./gui/views/${viewComponentName}`).default;
react_dom_1.render(React.createElement(view, null), document.getElementById("appcontainer"));
});This is a recurrnig issue. #14351
I reported this previously.
After compilation appears
Object.defineProperty(exports, "__esModule", { value: true });
and the result is "Uncaught ReferenceError: exports is not defined.
Ther is no actual module exported in the file. If I manually remove this piece of code everything works fine.
SlurpTheo and jchapuis
Metadata
Metadata
Assignees
Labels
Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified