question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module parse failed: Unexpected token When adding auth-passport package and creating strategy

See original GitHub issue

Bug report

Describe the bug

A clear and concise description of the bug.

To Reproduce

Steps to reproduce the behaviour. Please provide code snippets or a repository:

  1. Create the starter project
  2. Add auth-passport package
  3. Create Google Auth strategy
  4. Go to adminUI
ERROR in <user folder>/node_modules/@keystonejs/auth-passport/node_modules/@keystonejs/app-admin-ui/client/components/ListTable.js 102:5
Module parse failed: Unexpected token (102:5)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
 // Functional Components
> type SortLinkProps = {
handleSortChange: Function,
active: boolean,

The same Error appears for a multitude of files

System information

  • OS: Ubuntu
  • Browser:Firefox

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
zenflowcommented, Apr 4, 2020

However, it’s more accurate to say that only password auth is currently supported in the admin UI. Other auth strategies still work when using the GraphQL endpoint.

@molomby Isn’t it kind of odd that passport auth is not supported by AdminUIApp, but it is supported by GraphQLApp, when auth strategy is an option only given to AdminUIApp (not GraphQLApp)?

const apps = [
  new GraphQLApp(),
  new AdminUIApp({ authStrategy: passportAuthStrategy }),
];

Probably “auth strategies” should have been independent “apps” to compose with your graphql app, admin ui app, etc. I would actually be super excited to collaborate and work on these new apps (app-password-auth, app-passport-auth) if there is interest in going that way.

1reaction
zenflowcommented, Apr 5, 2020

OK I opened issue #2658 because I think this “make AdminUIApp work with passport auth” stuff may be off topic of the original issue.

@molomby Would you be at all able to review my changes in PR #2657 (which include making the Admin UI support passport auth)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module parse failed: Unexpected token - Stack Overflow
Apparently it happened because you have two module properties in the webpack config object. Given JS objects can only hold one value per...
Read more >
Module parse failed: Unexpected token (1:0) - Laracasts
Hello , After running npm run watch I see this error : ERROR in ./resources/js/components/irp/admin/EditGroup.vue 1:0 Module parse failed: Unexpected token ...
Read more >
Odyssey Lift-off I: "Module parse failed: Unexpected token" Error
Hello, I am on the “useQuery hook” step attempting to implement the grid. Here is my code that I think is problematic: const...
Read more >
r/reactjs - Reddit
src/index.js 14:2 Module parse failed: Unexpected token (14:2) You ... in package.json to "react-scripts": "^4.0.3" . create-react-app is ...
Read more >
.JS file in SPFX WebPart: Module parse failed: Unexpected ...
I have created an SPFx project with reactJS. I am using .jsx extension - functional components. Now, the spfx webpart is already working ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found