okta / okta-signin-widget

HTML/CSS/JS widget that provides out-of-the-box authentication UX for your organization's apps
Other
375 stars 320 forks source link

Bug: Failure to start development page #1066

Open oukjweather opened 4 years ago

oukjweather commented 4 years ago

:information_source: If you have a question, please post it on the Okta Developer Forum instead. Issues in this repository are reserved for bug reports and feature requests.

I'm submitting a

Background info

Describe your issue or request here (if necessary).

Clone the repo to my local machine. Run the following:

yarn
yarn start

The result I get back is the following in console logs of Chrome (79.0.3945.130):

Uncaught TypeError: $export is not a function
    at Object.<anonymous> (es6.object.define-property.js:3)
    at __webpack_require__ (bootstrap 28b7b13b5a317583a4df:19)
    at Object.<anonymous> (define-property.js:1)
    at __webpack_require__ (bootstrap 28b7b13b5a317583a4df:19)
    at Object.<anonymous> (define-property.js:1)
    at __webpack_require__ (bootstrap 28b7b13b5a317583a4df:19)
    at Object.<anonymous> (okta-sign-in.js:15348)
    at __webpack_require__ (bootstrap 28b7b13b5a317583a4df:19)
    at Object.<anonymous> (_hide.js:1)
    at __webpack_require__ (bootstrap 28b7b13b5a317583a4df:19)

main.js:6 Uncaught ReferenceError: OktaSignIn is not defined
    at Object.<anonymous> (main.js:6)
    at __webpack_require__ (bootstrap d98ad7e93195ea1b8b45:19)
    at Object.<anonymous> (html5-entities.js:190)
    at __webpack_require__ (bootstrap d98ad7e93195ea1b8b45:19)
    at bootstrap d98ad7e93195ea1b8b45:62
    at bootstrap d98ad7e93195ea1b8b45:62

Expected behavior

What should have happened?

Should have loaded a page with the login widget with no errors.

What went wrong?

Please provide log or error messages if applicable.

Uncaught TypeError: $export is not a function
    at Object.<anonymous> (es6.object.define-property.js:3)
    at __webpack_require__ (bootstrap 28b7b13b5a317583a4df:19)
    at Object.<anonymous> (define-property.js:1)
    at __webpack_require__ (bootstrap 28b7b13b5a317583a4df:19)
    at Object.<anonymous> (define-property.js:1)
    at __webpack_require__ (bootstrap 28b7b13b5a317583a4df:19)
    at Object.<anonymous> (okta-sign-in.js:15348)
    at __webpack_require__ (bootstrap 28b7b13b5a317583a4df:19)
    at Object.<anonymous> (_hide.js:1)
    at __webpack_require__ (bootstrap 28b7b13b5a317583a4df:19)

main.js:6 Uncaught ReferenceError: OktaSignIn is not defined
    at Object.<anonymous> (main.js:6)
    at __webpack_require__ (bootstrap d98ad7e93195ea1b8b45:19)
    at Object.<anonymous> (html5-entities.js:190)
    at __webpack_require__ (bootstrap d98ad7e93195ea1b8b45:19)
    at bootstrap d98ad7e93195ea1b8b45:62
    at bootstrap d98ad7e93195ea1b8b45:62

Steps to reproduce

If the current behavior is a bug, please provide the steps to reproduce and a minimal demo if possible (you can use this template as a starting point: https://jsfiddle.net/m2gyLq4v/).

Your environment

swiftone commented 4 years ago

@oukjweather - Thanks for the report. A few questions to help us diagnose the issue:

oukjweather commented 4 years ago

@oukjweather - Thanks for the report. A few questions to help us diagnose the issue:

  • What version of node are you running?
  • Have you only seen this on Windows machines?

Hi. I'm running node 12.16.1. Yes, the only machine I have access to is Windows 10.

davekats commented 4 years ago

I am having the same issue on Windows. Node version 10.16.3.

davekats commented 4 years ago

@oukjweather This seemed to fix it for me. It looks the issue is with the difference in path separators between Mac/Linux and Windows. Just replace the exclude block in webpack.common.config.js with this code and then run yarn install and yarn start.

exclude: function (filePath) {
  const filePathContains = (f) => filePath.indexOf(f) > 0;
  const s = path.sep;
  const npmRequiresTransform = [
    `${s}node_modules${s}parse-ms`,
    `${s}node_modules${s}@sindresorhus${s}to-milliseconds`
  ].some(filePathContains);
  const shallBeExcluded = [
    `${s}node_modules${s}`,
    `packages${s}@okta${s}courage-dist${s}jquery.js`,
    `packages${s}@okta${s}qtip2`
  ].some(filePathContains);

  return shallBeExcluded && !npmRequiresTransform;
}
shuowu-okta commented 4 years ago

Can you try yarn start:playground instead. This command will run the playground in watch mode. It depends on concurrently, which suppose to support Windows well.

Steve-OH commented 3 years ago

@shuowu-okta I can confirm that the issue still exists with the latest code, and that the fix proposed by @davekats works for me, too, on Windows 10.