teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

状況が変わりましたので内容を変更しました

2020/12/10 06:18

投稿

Pro01x19
Pro01x19

スコア17

title CHANGED
@@ -1,1 +1,1 @@
1
- 非同期通信がしたい application.js:9 Uncaught Error: Cannot find module 'jquery'
1
+ 非同期通信がしたい Uncaught Error: Syntax error, unrecognized expression: #like-button-#{@post.id}
body CHANGED
@@ -11,12 +11,18 @@
11
11
  ### 発生している問題・エラーメッセージ
12
12
 
13
13
  ```
14
+ Uncaught Error: Syntax error, unrecognized expression: #like-button-#{@post.id}
15
+ at Function.se.error (jquery-3.4.1.min.js:2)
16
+ at se.tokenize (jquery-3.4.1.min.js:2)
17
+ at se.select (jquery-3.4.1.min.js:2)
14
- Uncaught Error: Cannot find module 'jquery'
18
+ at Function.se [as find] (jquery-3.4.1.min.js:2)
19
+ at k.fn.init.find (jquery-3.4.1.min.js:2)
15
- at webpackMissingModule (application.js:9)
20
+ at new k.fn.init (jquery-3.4.1.min.js:2)
16
- at Object../app/javascript/packs/application.js (application.js:9)
17
- at __webpack_require__ (bootstrap:19)
21
+ at k (jquery-3.4.1.min.js:2)
22
+ at <anonymous>:1:1
23
+ at processResponse (rails-ujs.js:283)
18
- at bootstrap:83
24
+ at rails-ujs.js:196
19
- at bootstrap:83
25
+
20
26
  ```
21
27
  と出ており、Googleの検索にかけても解決策が見出せず現在に至ります。
22
28
 
@@ -25,6 +31,8 @@
25
31
 
26
32
  ```Gem
27
33
 
34
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
35
+
28
36
  gem 'pry-rails'
29
37
 
30
38
  gem 'devise'
@@ -36,6 +44,8 @@
36
44
 
37
45
  gem 'jquery-rails'
38
46
 
47
+ gem 'jquery-turbolinks'
48
+
39
49
  ```
40
50
 
41
51
  ```
@@ -44,9 +54,13 @@
44
54
  require("@rails/ujs").start()
45
55
  require("@rails/activestorage").start()
46
56
  require("channels")
47
- require('jquery') ←9行目
57
+ require('jquery')
58
+ require('turbolinks')
48
59
  require("bootstrap")
60
+
61
+ import 'bootstrap';
49
- require("@fortawesome/fontawesome-free")
62
+ import '../stylesheets/application';
63
+
50
64
  ```
51
65
 
52
66
  ```